From 859b5674780eb76c33a8d3d502ed1a5b9bed52f9 Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Tue, 2 Feb 2016 08:52:16 +0900 Subject: [PATCH] Add temporary upgrade check. New in 0.5.0 is $fisher_file that points to the user fishfile. Users upgrading from < 0.4.0 will not have this variable set, which can cause errors whenever Fisherman tries to access it. This commit adds a simple check to define the variable in the within the same session and improves the update log message to display the version Fisherman was updated to. --- functions/fisher_update.fish | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/functions/fisher_update.fish b/functions/fisher_update.fish index 890298d..57200af 100644 --- a/functions/fisher_update.fish +++ b/functions/fisher_update.fish @@ -37,7 +37,17 @@ function fisher_update -d "Update Plugins/Fisherman" return 1 end - printf "Done without errors. (%0.fs)\n" (math (date +%s) - $time) > $error + ############################# + ## Remove before 1.0 + set -g fisher_file $fisher_config/fishfile + if test ! -e $fisher_file + touch $fisher_file + end + ## Remove before 1.0 + ############################# + + printf "Aye! Fisherman updated to version %s (%0.fs)\n" ( + cat $fisher_home/VERSION) (math (date +%s) - $time) > $error case \* set -l time (date +%s)