From feb914dd16f955533746a97238ba85f76d90ef8a Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Thu, 11 Jan 2018 10:37:26 -0800 Subject: [PATCH] Add install hook with 2.2.x support instructions. Fixes #124 --- hooks/install.fish | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 hooks/install.fish diff --git a/hooks/install.fish b/hooks/install.fish new file mode 100644 index 0000000..354f433 --- /dev/null +++ b/hooks/install.fish @@ -0,0 +1,19 @@ +set -l required_version 2.3.0 + +set -l installed_version 1 +if set -q FISH_VERSION + set installed_version $FISH_VERSION +else if set -q version + set installed_version $version +end + +set -l latest_version (echo -e "$required_version\\n$installed_version" | command sort -r -n -t '.' -k 1,1 -k 2,2 -k 3,3 -k 4,4 | command head -n 1) + +if [ "$installed_version" != "$latest_version" ] + set_color red ^/dev/null + echo "Fish $required_version or greater is required for bobthefish." + echo + echo "To use bobthefish with Fish $installed_version, checkout the `support/fish-2.2.x` branch" + echo "in $OMF_PATH/themes/bobthefish/" + set color normal ^/dev/null +end