summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2015-10-04 14:19:16 +0200
committerMatthias Beyer <mail@beyermatthias.de>2015-10-04 14:19:16 +0200
commit17288aec4739a687f552a932d721615da047f157 (patch)
tree3ccfbfdff45863eec8955fcfa6cc1a44a3ca4150
parent31f574aaa2819c72dfcc2ac7905a85b744922dfa (diff)
Do not generate config tag if cmd is "build"
Closes #101. If the command for rebuilding the system is "build", the "switch" command should not generate a tag in the configuration. A tag in the nixpkgs clone can be generated, though.
-rwxr-xr-xnix-script-switch.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/nix-script-switch.sh b/nix-script-switch.sh
index bd26c76..ca4bf9b 100755
--- a/nix-script-switch.sh
+++ b/nix-script-switch.sh
@@ -53,6 +53,10 @@ usage() {
nix-script -v switch -c switch -w /home/me/config -n
+ This command does not generate a tag in the configuration if
+ the command is "build". A tag in the nixpkgs clone can be
+ generated, though.
+
$(help_rcvars \
"RC_CONFIG - Path of your system configuration (git) directory"\
"RC_NIXPKGS - Path of your nixpkgs clone" \
@@ -184,7 +188,12 @@ then
fi
fi
-__git "$WD" tag $TAG_FLAGS "$TAG_NAME" "$TAG_TARGET"
+if [[ "$COMMAND" =~ "build" ]]
+then
+ stdout "Command is 'build'. Not generating config tag"
+else
+ __git "$WD" tag $TAG_FLAGS "$TAG_NAME" "$TAG_TARGET"
+fi
if [[ $TAG_NIXPKGS -eq 1 ]]
then