dgy
/
hexagons
Archived
1
0
Fork 0
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.
hexagons/.local/bin/crear

17 lines
315 B
Bash
Executable File

#!/usr/bin/env bash
set -euf -o pipefail
FOLDER="$HOME/.local/bin"
FILE="$FOLDER/$1"
if [[ -f $FILE ]]; then
echo -e "Already exists. Press ENTER to edit or CTRL+C to cancel"
read -r
$EDITOR "$FILE"
else
echo -e "#!/usr/bin/env bash\\nset -euf -o pipefail\\n" > "$FILE"
chmod +x "$FILE"
$EDITOR "$FILE"
fi