Skip to content

Commit 82e27a1

Browse files
committed
Bootstrap: add default config files location check
The script validates now both config files before attempting to read them and exits with a clear message. Before this change, running bootstrap.sh without config/global.yaml produced the "No such file or directory" bash error.
1 parent 9b11a5a commit 82e27a1

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

bootstrap.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ getValue(){
99

1010
global_vars=${1:-config/global.yaml}
1111
certs_vars=${2:-config/certificates.yaml}
12+
13+
if [ ! -f "$global_vars" ]; then
14+
echo "Error: $global_vars not found."
15+
if [ -z "$1" ]; then
16+
echo "Copy config/global.example.yaml to $global_vars and fill in your values."
17+
fi
18+
exit 1
19+
fi
20+
21+
if [ ! -f "$certs_vars" ]; then
22+
echo "Error: $certs_vars not found."
23+
if [ -z "$2" ]; then
24+
echo "Copy config/certificates.example.yaml to $certs_vars and fill in your values."
25+
fi
26+
exit 1
27+
fi
28+
1229
workingDir=$(getValue .workingDir)
1330
lck=~/.lck-rh-lz
1431
DSTAMP=$(date +%Y%m%d_%H%M%S)

0 commit comments

Comments
 (0)