feat: Add utils.isNewer
This commit is contained in:
parent
d053af28bb
commit
224a2fdd28
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
from typing import Any, TypeVar, cast, Optional, Union
|
from typing import Any, TypeVar, cast, Optional, Union
|
||||||
import json
|
import json
|
||||||
import hashlib
|
import hashlib
|
||||||
|
@ -56,3 +57,7 @@ def asList(i: Optional[Union[T, list[T]]]) -> list[T]:
|
||||||
if isinstance(i, list):
|
if isinstance(i, list):
|
||||||
return cast(list[T], i)
|
return cast(list[T], i)
|
||||||
return [i]
|
return [i]
|
||||||
|
|
||||||
|
|
||||||
|
def isNewer(path1: str, path2: str) -> bool:
|
||||||
|
return not os.path.exists(path2) or os.path.getmtime(path1) > os.path.getmtime(path2)
|
||||||
|
|
Loading…
Reference in a new issue