diff options
Diffstat (limited to 'disko')
-rwxr-xr-x | disko | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1,9 +1,11 @@ #!/usr/bin/env bash set -euo pipefail -set -x readonly libexec_dir="${0%/*}" +# a file with the disko config +declare disko_config + # mount was chosen as the default mode because it's less destructive mode=mount nix_args=() @@ -30,6 +32,11 @@ abort() { ## Main ## +[[ $# -eq 0 ]] && { + showUsage + exit 1 +} + while [[ $# -gt 0 ]]; do case "$1" in -m | --mode) @@ -46,10 +53,11 @@ while [[ $# -gt 0 ]]; do exit 0 ;; *) - if [ -z ${disko_config+x} ] && [ -e $1 ]; then + if [ -z ${disko_config+x} ] && [ -e "$1" ]; then disko_config=$1 else showUsage + exit 1 fi ;; esac |