mirror of
https://github.com/jorgebucaran/fisher
synced 2024-10-09 09:36:53 +02:00
Use perl or python (whichever is available and in that order) to check index age.
This commit is contained in:
parent
6df88ca8e1
commit
b1f59fa699
1 changed files with 6 additions and 5 deletions
11
fisher.fish
11
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
|
||||
|
|
Loading…
Reference in a new issue