1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-28 10:32:46 +00:00

refactor: restore shell script extensions

Without an extension, the shell script configuration in `.gitattribute` will not work.
This commit is contained in:
Cotes Chung
2024-06-01 04:11:01 +08:00
parent 64ae7a3671
commit 1c5fa0880d
7 changed files with 6 additions and 6 deletions

50
tools/run.sh Executable file
View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
#
# Run jekyll serve and then launch the site
prod=false
command="bundle exec jekyll s -l"
host="127.0.0.1"
help() {
echo "Usage:"
echo
echo " bash /path/to/run [options]"
echo
echo "Options:"
echo " -H, --host [HOST] Host to bind to."
echo " -p, --production Run Jekyll in 'production' mode."
echo " -h, --help Print this help information."
}
while (($#)); do
opt="$1"
case $opt in
-H | --host)
host="$2"
shift 2
;;
-p | --production)
prod=true
shift
;;
-h | --help)
help
exit 0
;;
*)
echo -e "> Unknown option: '$opt'\n"
help
exit 1
;;
esac
done
command="$command -H $host"
if $prod; then
command="JEKYLL_ENV=production $command"
fi
echo -e "\n> $command\n"
eval "$command"