From 543afc7c018fc322bf03659f599eb9caf08bbec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Dj=C3=A4rv?= Date: Fri, 16 Sep 2016 17:49:36 +0200 Subject: [PATCH] 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 --- bin/install | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/install b/bin/install index 95ed24d..252020f 100755 --- a/bin/install +++ b/bin/install @@ -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