assert fish version before asserting commands (#399)

* assert fish version before asserting commands

- fix #398 so that the correct error message is displayed

* move assert_cmds to after fish and git checks

- remove fish and git from assert_cmds, these checks are already done in their specific assert_ functions making them redundant in assert_cmds
- move function assert_cmds to match execution order
pull/400/head
Mathias Djärv 8 years ago committed by Stephen M. Coakley
parent 4e48fcdcea
commit 543afc7c01

@ -72,9 +72,9 @@ Options:
end
# Ensure the environment meets all of the requirements.
assert_cmds
assert_fish_version_compatible 2.2.0
assert_git_version_compatible 1.9.5
assert_cmds
assert_interactive
# If the user wants to uninstall, jump to uninstallation and exit.
@ -441,17 +441,6 @@ function is_version_compatible -a lhs rhs
end
# Assert that all tools we need are available.
function assert_cmds
set -l cmds basename cp cut date dirname fish fold git head mkdir mv rm sed sort tar tr
for cmd in $cmds
type -f -q $cmd
or abort "Command '$cmd' not found"
end
end
# Assert that a minimum required version of Fish is installed.
function assert_fish_version_compatible -a required_version
set -l installed_version (get_fish_version)
@ -468,6 +457,17 @@ function assert_git_version_compatible -a required_version
end
# Assert that all tools we need are available.
function assert_cmds
set -l cmds basename cp cut date dirname fold head mkdir mv rm sed sort tar tr
for cmd in $cmds
type -f -q $cmd
or abort "Command '$cmd' not found"
end
end
# Ensures the keyboard is readable if in interactive mode.
function assert_interactive
set -q NONINTERACTIVE

Loading…
Cancel
Save