From 2a59af78a8e2e7ab6fc7a4be3671da0c19a8806c Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sat, 5 Nov 2022 14:25:08 -0500 Subject: fix: add package build and fix disko --- disko | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'disko') diff --git a/disko b/disko index c5b9d49..f51339e 100755 --- a/disko +++ b/disko @@ -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 -- cgit v1.2.3