Skip to content

Commit 87c3f50

Browse files
committed
Add dev.sh option guards and restore local dev ignores
1 parent 78393db commit 87c3f50

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,9 @@ sitemap.xml
4646
Hide_Tree_Page.md
4747
Gemfile.lock
4848
Gemfile
49+
50+
# Local development workspace
51+
.dev/
52+
.bundle/
53+
.jekyll-cache/
54+
.sass-cache/

scripts/dev.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,34 @@ Options:
3535
EOF
3636
}
3737

38+
require_option_value() {
39+
if [[ $# -lt 2 || -z "${2:-}" || "${2:-}" == --* ]]; then
40+
echo "Missing value for option: $1" >&2
41+
show_help
42+
exit 1
43+
fi
44+
}
45+
3846
while [[ $# -gt 0 ]]; do
3947
case "$1" in
4048
--template-repo-url)
41-
template_repo_url="${2:-}"
49+
require_option_value "$@"
50+
template_repo_url="$2"
4251
shift 2
4352
;;
4453
--template-branch)
45-
template_branch="${2:-}"
54+
require_option_value "$@"
55+
template_branch="$2"
4656
shift 2
4757
;;
4858
--port)
49-
port="${2:-}"
59+
require_option_value "$@"
60+
port="$2"
5061
shift 2
5162
;;
5263
--bind-host)
53-
bind_host="${2:-}"
64+
require_option_value "$@"
65+
bind_host="$2"
5466
shift 2
5567
;;
5668
--no-template-update)

0 commit comments

Comments
 (0)