Ensure that script never operates with empty basedir

This commit is contained in:
Martin Puppe 2024-01-18 15:43:25 +01:00
parent 698fc0c6d3
commit 386eeaf404
3 changed files with 8 additions and 3 deletions

View file

@ -101,7 +101,7 @@ If a file is specified as a string "path/to/file", this is equivalent to
## Copyright ## Copyright
Copyright 2020 Martin Puppe Copyright 2020-2024 Martin Puppe
This file is part of Secrets. This file is part of Secrets.

View file

@ -2,7 +2,7 @@
#lang racket #lang racket
#| #|
Copyright 2020 Martin Puppe Copyright 2020-2024 Martin Puppe
This file is part of Secrets. This file is part of Secrets.
@ -90,6 +90,11 @@ rm "$0"
echo "!*data" >&2 echo "!*data" >&2
read basedir read basedir
# exit if $basedir is an empty string
test -z "$basedir" && exit 1
# create $basedif if it does not exist
if test ! -d "$basedir"; then if test ! -d "$basedir"; then
install -o root -g root -m 755 -d "$basedir" install -o root -g root -m 755 -d "$basedir"
fi fi

View file

@ -1,5 +1,5 @@
/* /*
Copyright 2020 Martin Puppe Copyright 2020-2024 Martin Puppe
This file is part of Secrets. This file is part of Secrets.