diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2015-07-11 15:21:46 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2015-07-11 15:21:46 +0200 |
commit | 714ea1e88b457b37a180118a1715cdf5cd05938d (patch) | |
tree | 8c5d05ad25c151eb021ebf50ecd0e3ad74910ae1 | |
parent | 1e5a783050dbba2b940a07135fe211b00631a4f4 (diff) | |
parent | 36d0006bf8c73cc4badfef969e42cb94407454c1 (diff) |
Merge pull request #53 from matthiasbeyer/remove-custom-git-command
switch: Remove -g flag support
-rwxr-xr-x | nix-script-switch.sh | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/nix-script-switch.sh b/nix-script-switch.sh index 9339cb7..70a9b67 100755 --- a/nix-script-switch.sh +++ b/nix-script-switch.sh @@ -9,10 +9,9 @@ COMMAND="switch" usage() { cat <<EOS - $(help_synopsis "${BASH_SOURCE[0]}" "[-h] [-c <command>] [-g <git command>] -w <working directory> [-- args...]") + $(help_synopsis "${BASH_SOURCE[0]}" "[-h] [-c <command>] -w <working directory> [-- args...]") -c <command> Command for nixos-rebuild. See 'man nixos-rebuild' - -g <git cmd> Alternative git commit, defaults to 'tag -a' -w <path> Path to your configuration git directory -n Include hostname in tag name -h Show this help and exit @@ -48,7 +47,6 @@ COMMAND= ARGS= WD= TAG_NAME= -GIT_COMMAND= HOSTNAME="" while getopts "c:w:t:nh" OPTION @@ -67,11 +65,6 @@ do stdout "TAG_NAME = $TAG_NAME" ;; - g) - GIT_COMMAND=$OPTARG - stdout "GIT_COMMAND = $GIT_COMMAND" - ;; - n) HOSTNAME=$(hostname) stdout "HOSTNAME = $HOSTNAME" @@ -93,7 +86,6 @@ stdout "ARGS = $ARGS" [[ ! -d "$WD" ]] && stderr "No directory: $WD" && exit 1 [[ -z "$COMMAND" ]] && COMMAND="switch" -[[ -z "$GIT_COMMAND" ]] && GIT_COMMAND="tag -a" explain sudo nixos-rebuild $COMMAND $ARGS REBUILD_EXIT=$? @@ -110,7 +102,7 @@ then fi fi - __git "$WD" $GIT_COMMAND "$TAG_NAME" + __git "$WD" tag -a "$TAG_NAME" else stderr "Switching failed. Won't executing any further commands." |