mirror of
https://github.com/IlanCosman/tide.git
synced 2024-09-11 17:15:34 +03:00
Pass flags from tide_install to _tide_actual_install fully (fixes #30)
This commit is contained in:
parent
37390beee5
commit
432cc5cce6
@ -1,12 +1,20 @@
|
|||||||
function tide_install
|
function tide_install
|
||||||
# If git isn't installed, there's nothing we can do
|
|
||||||
if not command -q git
|
if not command -q git
|
||||||
printf '%s\n' 'Git must be installed to download Tide.'
|
printf '%s\n' 'Git must be available to install Tide.'
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
argparse --ignore-unknown 'l/local' -- $argv
|
set -l options l/local u/unattended
|
||||||
|
argparse $options -- $argv
|
||||||
|
|
||||||
|
# Pass through options to _tide_actual_install
|
||||||
|
for option in $options
|
||||||
|
set -l longFormOption (string split '/' $option)[2]
|
||||||
|
if set -q _flag_$longFormOption
|
||||||
|
set -a flags "--$longFormOption"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
set -l location $argv[-1]
|
set -l location $argv[-1]
|
||||||
if test -z "$location"
|
if test -z "$location"
|
||||||
set location 'main'
|
set location 'main'
|
||||||
@ -14,8 +22,6 @@ function tide_install
|
|||||||
|
|
||||||
if set -q _flag_local
|
if set -q _flag_local
|
||||||
source "$location/tools/_tide_actual_install.fish"
|
source "$location/tools/_tide_actual_install.fish"
|
||||||
|
|
||||||
set -a flags '-l'
|
|
||||||
else
|
else
|
||||||
curl --silent "https://raw.githubusercontent.com/IlanCosman/tide/$location/tools/_tide_actual_install.fish" | source
|
curl --silent "https://raw.githubusercontent.com/IlanCosman/tide/$location/tools/_tide_actual_install.fish" | source
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user