#!/bin/bash
if [[ "$1" == "" ]]; then
	echo "Usage: ${0##*/} <script-name>"; exit 2
fi

SCRIPT_FOLDER="$HOME/.local/bin"
SCRIPT_FILE="$SCRIPT_FOLDER/$1"

set -euo pipefail

if [[ ! -f $SCRIPT_FILE ]]; then
	cat > $SCRIPT_FILE << EOM
#!/bin/bash
set -euo pipefail

EOM

	chmod +x $SCRIPT_FILE
fi
$EDITOR $SCRIPT_FILE

