From b1f59fa69913c3c3f2f87631f37b02ef7d910040 Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Mon, 2 May 2016 02:54:45 +0900 Subject: [PATCH] Use perl or python (whichever is available and in that order) to check index age. --- fisher.fish | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fisher.fish b/fisher.fish index c999afa..1d7b012 100644 --- a/fisher.fish +++ b/fisher.fish @@ -1715,12 +1715,13 @@ end function __fisher_get_file_age -a file - if not type -q python - return 1 - end + if type -q perl + perl -e "printf(\"%s\n\", time - (stat ('$file'))[9])" ^ /dev/null - python -c "import os, time; print int(time.time() - os.path.getmtime('$file'))" ^ /dev/null -end + else if type -q python + python -c "from __future__ import print_function; import os, time; print(int(time.time() - os.path.getmtime('$file')))" ^ /dev/null + end +end function __fisher_usage