'save-at:1722225148.8869774'
This commit is contained in:
parent
a6222ab188
commit
cc00240574
|
@ -0,0 +1,21 @@
|
|||
import sys
|
||||
import shutil as cmd
|
||||
|
||||
|
||||
base_store_path = r"E:\baseline_core\milestone.xast"
|
||||
current_store_path = r"E:\storyline.xast"
|
||||
|
||||
|
||||
def milestone_new(f_from: str, f_to: str) -> str:
|
||||
return cmd.copy2(f_from, f_to)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(sys.argv)
|
||||
if len(sys.argv) <= 1:
|
||||
exit(0)
|
||||
|
||||
# milestone:new
|
||||
if "".join(sys.argv[1:]) == "milestone:new":
|
||||
milestone_new(current_store_path, base_store_path)
|
||||
pass
|
|
@ -0,0 +1,29 @@
|
|||
import sys, os
|
||||
import subprocess as xsub
|
||||
import time
|
||||
|
||||
|
||||
def git_save(target_dir: str):
|
||||
retls = xsub.run("git status", shell=True, capture_output=True)
|
||||
print(retls.stdout)
|
||||
outlist = str(retls.stdout).split(r'\n')
|
||||
has_changed:bool = False
|
||||
for o in outlist:
|
||||
if o.startswith(r"\tmodified:"):
|
||||
has_changed = True
|
||||
break
|
||||
elif o.startswith(r"\tnew file:"):
|
||||
has_changed = True
|
||||
break
|
||||
|
||||
if has_changed:
|
||||
xsub.run("git add .", shell=True)
|
||||
xsub.run(f"git commit -m 'save-at:{time.time()}'")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(sys.argv)
|
||||
cmd_line = ":".join(sys.argv[1:])
|
||||
#wnss:-cmp
|
||||
if cmd_line == "wnss:-cmp":
|
||||
git_save(os.getcwd())
|
Loading…
Reference in New Issue