aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-02-15 14:53:42 +0300
committerMunyoki Kilyungi2024-02-15 15:05:36 +0300
commitd6b5d93e9b7fdb4d07a2ed7e7651bcdadb7c940c (patch)
treedf49acbbb4b144c44bba38d751ddee312737c502 /examples
parent92d048cd9b9512408383e138b272b42a0c20bb13 (diff)
downloadgn-transform-databases-d6b5d93e9b7fdb4d07a2ed7e7651bcdadb7c940c.tar.gz
Refactor how changes are committed and pushed.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/dataset-metadata-git.scm27
1 files changed, 12 insertions, 15 deletions
diff --git a/examples/dataset-metadata-git.scm b/examples/dataset-metadata-git.scm
index 32b738b..c9ea59b 100755
--- a/examples/dataset-metadata-git.scm
+++ b/examples/dataset-metadata-git.scm
@@ -65,15 +65,6 @@
("contributors.rtf" . ,contributors)
("acknowledgment.rtf" . ,acknowledgment)))))
-(define* (commit-changes
- directory
- #:optional (commit-message "Update dataset RTF Files."))
- (chdir directory)
- (system "git reset --hard origin master")
- (system "git pull")
- (system "git add .")
- (system (format #f "git commit -m ~s" commit-message))
- (system "git push origin master"))
(let* ((option-spec
'((settings (single-char #\s) (value #t))))
@@ -89,9 +80,15 @@ FROM InfoFiles LEFT JOIN Datasets USING (DatasetId)")
(call-with-target-database
%connection-settings
(lambda (db)
- (sql-for-each infopages/sql->rtf
- db
- query)
- (commit-changes "/export/data/genenetwork/gn-docs/"))))
-
-
+ (let ((dir "/export/data/genenetwork/gn-docs/"))
+ (chdir dir)
+ (system "git reset --hard origin")
+ (system "git pull")
+ ;; Clear directory so that we can re-do the dump again from the db.
+ (system "rm -rf general/datasets/*/")
+ (sql-for-each infopages/sql->rtf
+ db
+ query)
+ (system "git add general/datasets")
+ (system (format #f "git commit -m ~s" "Update dataset RTF Files."))
+ (system "git push origin master")))))