🔧 Modified scrpt to check for file first

This commit is contained in:
z3rOR0ne 2023-11-21 23:38:50 -08:00
parent 88d52fa7a4
commit 4f3a0c000f

View file

@ -1,6 +1,12 @@
#!/usr/bin/env bash
filename=$1
if [[ -f "$filename" ]]; then
echo "File: $filename already exists."
exit 1
fi
touch "$filename"
chmod +x "$filename"
echo "#!/usr/bin/env bash" >> "$filename"
echo "#!/usr/bin/env bash" >>"$filename"