Lazy commit on fry.
This commit is contained in:
parent
7b2ec93611
commit
5a95555672
@ -119,6 +119,7 @@ def isFossil(cfg):
|
|||||||
|
|
||||||
def perform_action(action, key, item, silent = False):
|
def perform_action(action, key, item, silent = False):
|
||||||
output = None
|
output = None
|
||||||
|
hn = hostname()
|
||||||
lbl = "{0}ing".format(action).title()
|
lbl = "{0}ing".format(action).title()
|
||||||
if os.path.exists(os.path.expanduser(item["path"])):
|
if os.path.exists(os.path.expanduser(item["path"])):
|
||||||
if action in list([ "pull", "push", "fetch" ]):
|
if action in list([ "pull", "push", "fetch" ]):
|
||||||
@ -157,7 +158,7 @@ def perform_action(action, key, item, silent = False):
|
|||||||
cwd = Path(os.path.expanduser(item["path"]))
|
cwd = Path(os.path.expanduser(item["path"]))
|
||||||
cmd = f"fossil add ."
|
cmd = f"fossil add ."
|
||||||
output = execute_command(cmd, cwd=cwd)
|
output = execute_command(cmd, cwd=cwd)
|
||||||
cmd = f"fossil commit -m \"Lazy commit on {hostname}\""
|
cmd = f"fossil commit -m \"Lazy commit on {hn}\""
|
||||||
output = execute_command(cmd, cwd=cwd)
|
output = execute_command(cmd, cwd=cwd)
|
||||||
else:
|
else:
|
||||||
cmd = "git -C \"{0}\" status --porcelain".format(os.path.expanduser(item["path"]))
|
cmd = "git -C \"{0}\" status --porcelain".format(os.path.expanduser(item["path"]))
|
||||||
@ -166,7 +167,7 @@ def perform_action(action, key, item, silent = False):
|
|||||||
print("Lazy committing {0}...".format(key))
|
print("Lazy committing {0}...".format(key))
|
||||||
cmd = "git -C \"{0}\" add .".format(os.path.expanduser(item["path"]))
|
cmd = "git -C \"{0}\" add .".format(os.path.expanduser(item["path"]))
|
||||||
output = execute_command(cmd)
|
output = execute_command(cmd)
|
||||||
cmd = "git -C \"{0}\" commit -m \"Lazy commit on {1}.\"".format(os.path.expanduser(item["path"]), hostname)
|
cmd = "git -C \"{0}\" commit -m \"Lazy commit on {1}.\"".format(os.path.expanduser(item["path"]), hn)
|
||||||
output = execute_command(cmd)
|
output = execute_command(cmd)
|
||||||
rm(filepath("status"))
|
rm(filepath("status"))
|
||||||
return output
|
return output
|
||||||
|
Loading…
x
Reference in New Issue
Block a user