summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()