fix: use perl for epoch only on FreeBSD & Darwin; fix #458

This commit is contained in:
Jorge Bucaran 2018-10-07 02:18:46 +09:00
parent 7850f78e8a
commit d7b9cd526d
No known key found for this signature in database
GPG key ID: E54BA3C0E646DB30

View file

@ -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"