1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-18 12:38:30 +02:00

home-manager: check whether a command is passed

"set -u" treats unset variables as an error, and $1 is unbound when no
command is passed.
This commit is contained in:
Mario Rodas 2018-01-22 00:46:33 -05:00 committed by Robert Helgesson
parent 38020d9068
commit 21fefbc8f6
No known key found for this signature in database
GPG Key ID: C3DB11069E65DC86

View File

@ -337,6 +337,11 @@ done
# Get rid of the options.
shift "$((OPTIND-1))"
if [[ $# -eq 0 ]]; then
doHelp >&2
exit 1
fi
cmd="$1"
shift 1