This repository has been archived on 2021-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
2018-08-28 16:13:36 +00:00
|
|
|
#!/usr/bin/env bash
|
2018-02-03 20:11:09 +00:00
|
|
|
|
2019-05-30 15:00:26 +00:00
|
|
|
set -euf -o pipefail
|
|
|
|
|
2020-03-29 19:16:35 +00:00
|
|
|
FOLDER="$HOME/.local/bin"
|
2018-02-03 20:11:09 +00:00
|
|
|
FILE="$FOLDER/$1"
|
|
|
|
|
|
|
|
if [[ -f $FILE ]]; then
|
2019-05-30 15:00:26 +00:00
|
|
|
echo -e "Already exists. Press ENTER to edit or CTRL+C to cancel"
|
|
|
|
read -r
|
|
|
|
$EDITOR "$FILE"
|
2018-02-03 20:11:09 +00:00
|
|
|
else
|
2019-01-08 13:01:43 +00:00
|
|
|
echo -e "#!/usr/bin/env bash\\nset -euf -o pipefail\\n" > "$FILE"
|
2018-08-03 10:50:24 +00:00
|
|
|
chmod +x "$FILE"
|
|
|
|
$EDITOR "$FILE"
|
2018-02-03 20:11:09 +00:00
|
|
|
fi
|