mirror of
https://github.com/IlanCosman/tide.git
synced 2024-08-16 19:50:22 +03:00
Switch to install/actual_install functions
This commit is contained in:
parent
855934cf4e
commit
b88ac8dc94
@ -1,10 +1,4 @@
|
||||
function tide_install
|
||||
# If git isn't installed, there's nothing we can do
|
||||
if not command -q git
|
||||
printf '%s\n' 'Git must be installed to download Tide.'
|
||||
return 1
|
||||
end
|
||||
|
||||
function tide_actual_install
|
||||
argparse 'l/local' 'd/dev' -- $argv
|
||||
|
||||
set -l location $argv[1]
|
24
tools/tide_install.fish
Normal file
24
tools/tide_install.fish
Normal file
@ -0,0 +1,24 @@
|
||||
function tide_install
|
||||
# If git isn't installed, there's nothing we can do
|
||||
if not command -q git
|
||||
printf '%s\n' 'Git must be installed to download Tide.'
|
||||
return 1
|
||||
end
|
||||
|
||||
argparse --ignore-unknown 'l/local' -- $argv
|
||||
|
||||
set -l location $argv[-1]
|
||||
if test -z "$location"
|
||||
set location 'master'
|
||||
end
|
||||
|
||||
if set -q _flag_local
|
||||
source "$location/tools/tide_actual_install.fish"
|
||||
|
||||
set -a flags '-l'
|
||||
else
|
||||
curl -s "https://raw.githubusercontent.com/IlanCosman/tide/$location/tools/tide_actual_install.fish" | source
|
||||
end
|
||||
|
||||
tide_actual_install $flags $argv
|
||||
end
|
Loading…
Reference in New Issue
Block a user