nixos-checkout: fix output if ran with no options, -h and --help. Other options will still trigger

mkdir output :(
This commit is contained in:
Evgeny Egorochkin 2013-08-06 18:56:10 +03:00
parent d28c85886f
commit 0bcabfa886

View File

@ -15,7 +15,12 @@ let
src = pkgs.writeScript "nixos-checkout"
''
#! ${pkgs.stdenv.shell} -e
if [ -z "$1" ] || [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
echo "Usage: `basename $0` PREFIX. See NixOS Manual for more info."
exit 0
fi
prefix="$1"
if [ -z "$prefix" ]; then prefix=/etc/nixos; fi
mkdir -p "$prefix"