Skip to content

Commit 1be62b5

Browse files
authored
Do not try to fetch last modified date if remote file (#707)
If the file given in the artifact is not local, then the code should not attempt to fetch the last modified date. This applies to cases where the file is "-" meaning standard input and artifacts with a URL when targeting GitHub repos and such. Signed-off-by: Eric Brown <eric.brown@securesauce.dev>
1 parent ce033f9 commit 1be62b5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

precli/core/artifact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __init__(self, file_name: str, uri: Optional[str] = None):
1515
self._encoding = "utf-8"
1616
self._language = None
1717

18-
if file_name != "-" or not uri:
18+
if file_name != "-" and not uri:
1919
modified_time = os.path.getmtime(file_name)
2020
self._last_modified = datetime.fromtimestamp(
2121
modified_time, tz=timezone.utc

0 commit comments

Comments
 (0)