summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2015-10-04 14:10:55 +0200
committerMatthias Beyer <mail@beyermatthias.de>2015-10-04 14:10:55 +0200
commit4c4813a379e8e439aa584be7f8b291394c139d8b (patch)
treee777436af492f80df61903cca0d5c40898bf2266
parent4bb80ed0998abf86d1aba24310ccc369ab670a91 (diff)
parentcbe184ccdc4fbf713bae56ffa1a4a70c44b17753 (diff)
Merge pull request #94 from matthiasbeyer/switch-fetch-commit-before-tag
Fetch commit hash before nixos-rebuild
-rwxr-xr-xnix-script-switch.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/nix-script-switch.sh b/nix-script-switch.sh
index 6848a57..bd26c76 100755
--- a/nix-script-switch.sh
+++ b/nix-script-switch.sh
@@ -147,6 +147,9 @@ dbg "ARGS = $ARGS"
[[ ! -d "$WD" ]] && stderr "No directory: $WD" && exit 1
+TAG_TARGET=$(__git "$WD" rev-parse HEAD)
+stdout "Tag in config will be generated at '$TAG_TARGET'"
+
if [[ -z "$DONT_BUILD" ]]
then
__q="-Q"
@@ -181,7 +184,7 @@ then
fi
fi
-__git "$WD" tag $TAG_FLAGS "$TAG_NAME"
+__git "$WD" tag $TAG_FLAGS "$TAG_NAME" "$TAG_TARGET"
if [[ $TAG_NIXPKGS -eq 1 ]]
then