julien colomb il y a 2 ans
Parent
commit
930cbb8fb0
2 fichiers modifiés avec 7 ajouts et 4 suppressions
  1. 6 3
      .scripts/datalad_sync.py
  2. 1 1
      Sync_unix

+ 6 - 3
.scripts/datalad_sync.py

@@ -1,4 +1,4 @@
-from heapq import merge
+from datetime import datetime
 import os
 import sys
 
@@ -25,12 +25,15 @@ dl.status(recursive=True, eval_subdataset_state ='commit', result_renderer ='tai
 commitmessage = input("Optionally enter a commit message, and hit return: ")
 if not commitmessage:
     print("using date as commit message")
-    commitmessage = "commit on" + {datetime.now().strftime('%Y-%m-%d')}
+    commitmessage = print("commit on" , datetime.now())
 
 # sync
+print("update changes from server")
 dl.update(how='merge', recursive=True)
+print("saving changes")
 dl.save(".", message=commitmessage, recursive=True)
-dl.push(".", to="origin", recursive=True)
+print("pushing saved changes to server")
+dl.push(to="origin", recursive=True)
 
 # Set dropping option
 q_answer = input("Do you want to drop all files that were uploaded, they will be on the server but not on this computer anymore ? [y/n]")

+ 1 - 1
Sync_unix

@@ -4,4 +4,4 @@ projectdir=$(git -C ${loc} rev-parse --show-toplevel)
 
 pushd ${loc} > /dev/null
 
-python3 .scripts/datalad_sync.py
+python3 .scripts/datalad_sync.py