Skip to content

Commit

Permalink
Git fetch when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhomer committed Sep 24, 2023
1 parent 274d596 commit 8a871fc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/git-synk
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def synk(path):
now = datetime.datetime.now()
if last_modified + datetime.timedelta(seconds=fetch_window) < now:
print(".", end="")
os.system("git fetch")
print(".", end="")
else:
print("∷ ", end="")
Expand All @@ -67,6 +68,10 @@ def synk(path):

def run():
cwd = os.getcwd()
match = re.search("projects/things", cwd)
if not match:
raise Exception("Can only sync in project/things directory")

print(cwd)
if is_git_repo(cwd):
synk(cwd)
Expand Down

0 comments on commit 8a871fc

Please sign in to comment.