Modify repo to be installable via fisher

This commit is contained in:
mitchell 2020-10-29 23:29:20 -04:00
parent 3b495dad5b
commit f3d8897187
3 changed files with 35 additions and 10 deletions

24
sw
View file

@ -1,14 +1,20 @@
#!/usr/bin/env fish
set -g cmd_func_prefix 'swim'
if test -f ./swim.fish
source ./swim.fish
else
echo 'No swim.fish found in current directory. Please copy the template from https://github.com/mitchell/swim.fish'
exit 1
end
function main
argparse --ignore-unknown 'i-init' -- $argv
set -g cmd_func_prefix 'swim'
if test -n "$_flag_init"
curl -fsS https://raw.githubusercontent.com/mitchell/swim.fish/master/swim.fish.example >swim.fish
return
end
if test -f ./swim.fish
source ./swim.fish
else
echo 'No swim.fish found. Run `sw --init` make one.'
return 1
end
run_swim_command $cmd_func_prefix $argv
end