#!/usr/bin/env bash
#
# new-bash - create new Bash shell script - newscript

EDITOR=${EDITOR:-vim}
script="$1"

if [ ! -f "${script}" ]; then
  cat > "${script}" <<-EOF
#!/usr/bin/env bash

set -eo pipefail

somefunction() {

    :

}

main() {

    somefunction

}

main "\$@"
EOF
  chmod +x "${script}"
fi

"${EDITOR}" "${script}"
