mirror of
https://github.com/jorgebucaran/fisher
synced 2024-10-09 09:36:53 +02:00
fix: use perl for epoch only on FreeBSD & Darwin; fix #458
This commit is contained in:
parent
7850f78e8a
commit
d7b9cd526d
1 changed files with 9 additions and 8 deletions
17
fisher.fish
17
fisher.fish
|
@ -2,14 +2,15 @@ set -g fisher_version 3.0.3
|
|||
|
||||
type source >/dev/null; or function source; . $argv; end
|
||||
|
||||
if command which perl >/dev/null
|
||||
function _fisher_now -a elapsed
|
||||
command perl -MTime::HiRes -e 'printf("%.0f\n", (Time::HiRes::time() * 1000) - $ARGV[0])' $elapsed
|
||||
end
|
||||
else
|
||||
function _fisher_now -a elapsed
|
||||
command date "+%s%3N" | command awk "{ sub(/3N\$/,\"000\"); print \$0 - 0$elapsed }"
|
||||
end
|
||||
switch (command uname)
|
||||
case Darwin FreeBSD
|
||||
function _fisher_now -a elapsed
|
||||
command perl -MTime::HiRes -e 'printf("%.0f\n", (Time::HiRes::time() * 1000) - $ARGV[0])' $elapsed
|
||||
end
|
||||
case \*
|
||||
function _fisher_now -a elapsed
|
||||
command date "+%s%3N" | command awk "{ sub(/3N\$/,\"500\"); print \$0 - 0$elapsed }"
|
||||
end
|
||||
end
|
||||
|
||||
function fisher -a cmd -d "fish package manager"
|
||||
|
|
Loading…
Reference in a new issue