summaryrefslogtreecommitdiffstats
path: root/disko
diff options
context:
space:
mode:
authorDavid Arnold <david.arnold@iohk.io>2022-11-05 14:25:08 -0500
committerlassulus <lassulus@lassul.us>2022-11-09 12:21:24 +0100
commit2a59af78a8e2e7ab6fc7a4be3671da0c19a8806c (patch)
tree8b26f8d4e15ac9d118350084516b99ff6e182fdd /disko
parentf82656afbd5dafe1a0f762bdb7678a62203158b0 (diff)
fix: add package build and fix disko
Diffstat (limited to 'disko')
-rwxr-xr-xdisko12
1 files changed, 10 insertions, 2 deletions
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