mirror of
				https://github.com/mitchell/swim.fish.git
				synced 2025-11-03 23:35:25 +00:00 
			
		
		
		
	Modify repo to be installable via fisher
This commit is contained in:
		
							parent
							
								
									3b495dad5b
								
							
						
					
					
						commit
						f3d8897187
					
				| 
						 | 
				
			
			@ -1,3 +1,22 @@
 | 
			
		|||
function sw -d 'The fish-based project script runner'
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
function run_swim_command -a prefix
 | 
			
		||||
    argparse --ignore-unknown 'h/help' -- $argv
 | 
			
		||||
    set -l command $argv[2]
 | 
			
		||||
							
								
								
									
										24
									
								
								sw
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								sw
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,5 +73,5 @@ function swim_fails -d 'This command fails every time'
 | 
			
		|||
    false
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
#curl -fsS https://raw.githubusercontent.com/mitchell/swim.fish/master/importable_sw.fish | source
 | 
			
		||||
#curl -fsS https://raw.githubusercontent.com/mitchell/swim.fish/master/functions/sw.fish | source
 | 
			
		||||
#run_swim_command $cmd_func_prefix $argv
 | 
			
		||||
		Loading…
	
		Reference in a new issue