Add make_scripts shell function to make bash script template

main
Buddy Sandidge 1 year ago
parent 1273f41da3
commit 359135964c

@ -13,6 +13,27 @@ source_env_file() {
)" )"
} }
make_scripts() (
for FILE in "$@"; do
make_script "${FILE}"
done
)
make_script() (
cat <<-EOF > "${1}"
#!/usr/bin/env bash
set -euo pipefail
main() (
echo "todo"
)
main "$@"
EOF
chmod +x "${1}"
)
add_date_prefix() ( add_date_prefix() (
DIR=$(dirname "$1") DIR=$(dirname "$1")
FILE=$(basename "$1") FILE=$(basename "$1")

Loading…
Cancel
Save