16 lines
465 B
Fish
16 lines
465 B
Fish
function mkfish --description 'Make an executable fish script'
|
|
if test (count $argv) -eq 0
|
|
echo Minimum one argument.
|
|
return 1
|
|
end
|
|
# each arg is a script to create
|
|
for name in $argv
|
|
if test -f "$name.fish"
|
|
echo Skipping existing file...
|
|
continue
|
|
end
|
|
printf '#!/usr/bin/env fish'\n\n"echo $name" >"$name.fish"
|
|
chmod +x "$name.fish"
|
|
path resolve "$name.fish"
|
|
end
|
|
end
|