Skip to content

Commit cde5356

Browse files
committed
Add safe help mode to setup script
1 parent 752442d commit cde5356

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

scripts/setup.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,38 @@
11
#!/bin/bash
22
# Media Stack Setup Helper
33
# Creates all required folders and prepares the .env file.
4+
# Usage: bash scripts/setup.sh [--help]
45

56
set -e
67

78
YELLOW='\033[1;33m'
89
GREEN='\033[0;32m'
910
NC='\033[0m'
1011

12+
usage() {
13+
cat <<EOF
14+
Usage: bash scripts/setup.sh
15+
16+
Creates Media folder structure and generates .env from .env.example.
17+
18+
Options:
19+
--help Show this help message
20+
EOF
21+
}
22+
23+
case "${1:-}" in
24+
"" ) ;;
25+
--help|-h)
26+
usage
27+
exit 0
28+
;;
29+
*)
30+
echo "Unknown option: $1"
31+
usage
32+
exit 1
33+
;;
34+
esac
35+
1136
echo ""
1237
echo "=============================="
1338
echo " Media Stack Setup"

0 commit comments

Comments
 (0)