summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-30 11:30:08 +0300
committerLars Wirzenius <liw@liw.fi>2021-03-30 12:04:20 +0300
commit38bbcad18e7c1860b88a1210a15b3dc3714c6055 (patch)
treea69d8055c2141a670b4820a042e5ebab3f6d2819
parent18208e85ecce606e4f530c76e83ea160f05463e1 (diff)
downloadbumper-rs-38bbcad18e7c1860b88a1210a15b3dc3714c6055.tar.gz
fix: initial git setup works to set user info
-rw-r--r--subplot/bumper.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/subplot/bumper.py b/subplot/bumper.py
index 3198e13..329173c 100644
--- a/subplot/bumper.py
+++ b/subplot/bumper.py
@@ -13,15 +13,36 @@ def install_bumper(ctx):
def git_init_and_commit_everything(ctx, dirname=None):
runcmd_run = globals()["runcmd_run"]
+ runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]
+
+ runcmd_run(
+ ctx, ["git", "config", "--global", "user.email", "me@example.com", dirname]
+ )
+ runcmd_exit_code_is_zero(ctx)
+
+ runcmd_run(
+ ctx, ["git", "config", "--global", "user.name", "J. Random Hacker", dirname]
+ )
+ runcmd_exit_code_is_zero(ctx)
+
runcmd_run(ctx, ["git", "init", dirname])
+ runcmd_exit_code_is_zero(ctx)
+
runcmd_run(ctx, ["git", "add", "."], cwd=dirname)
+ runcmd_exit_code_is_zero(ctx)
+
runcmd_run(ctx, ["git", "commit", "-minitial"], cwd=dirname)
+ runcmd_exit_code_is_zero(ctx)
def remember_HEAD(ctx, dirname=None, varname=None):
runcmd_run = globals()["runcmd_run"]
runcmd_get_stdout = globals()["runcmd_get_stdout"]
+
runcmd_run(ctx, ["git", "rev-parse", "HEAD"], cwd=dirname)
+ runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]
+ runcmd_exit_code_is_zero(ctx)
+
ctx[varname] = runcmd_get_stdout(ctx).strip()