mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 10:01:14 -03:00
Revert "Switch to bare vars in our math invocations"
This reverts commit bd18736ee5.
Bare variables should only be used in commands that must
manipulate the variable stack, such as `set`.
This commit is contained in:
@@ -40,9 +40,7 @@ function __fish_print_packages
|
||||
set cache_file $XDG_CACHE_HOME/.pac-cache.$USER
|
||||
if test -f $cache_file
|
||||
cat $cache_file
|
||||
set -l x (date +%s)
|
||||
set -l y (stat -c '%Y' $cache_file)
|
||||
set age (math x - y)
|
||||
set age (math (date +%s) - (stat -c '%Y' $cache_file))
|
||||
set max_age 250
|
||||
if test $age -lt $max_age
|
||||
return
|
||||
@@ -67,9 +65,7 @@ function __fish_print_packages
|
||||
set -l cache_file $XDG_CACHE_HOME/.zypper-cache.$USER
|
||||
if test -f $cache_file
|
||||
cat $cache_file
|
||||
set -l x (date +%s)
|
||||
set -l y (stat -c '%Y' $cache_file)
|
||||
set -l age (math x - y)
|
||||
set -l age (math (date +%s) - (stat -c '%Y' $cache_file))
|
||||
set -l max_age 300
|
||||
if test $age -lt $max_age
|
||||
return
|
||||
@@ -89,9 +85,7 @@ function __fish_print_packages
|
||||
set cache_file $XDG_CACHE_HOME/.yum-cache.$USER
|
||||
if test -f $cache_file
|
||||
cat $cache_file
|
||||
set -l x (date +%s)
|
||||
set -l y (stat -c '%Y' $cache_file)
|
||||
set age (math x - y)
|
||||
set age (math (date +%s) - (stat -c '%Y' $cache_file))
|
||||
set max_age 21600
|
||||
if test $age -lt $max_age
|
||||
return
|
||||
@@ -113,9 +107,7 @@ function __fish_print_packages
|
||||
set cache_file $XDG_CACHE_HOME/.rpm-cache.$USER
|
||||
if test -f $cache_file
|
||||
cat $cache_file
|
||||
set -l x (date +%s)
|
||||
set -l y (stat -c '%Y' $cache_file)
|
||||
set age (math x - y)
|
||||
set age (math (date +%s) - (stat -c '%Y' $cache_file))
|
||||
set max_age 250
|
||||
if test $age -lt $max_age
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user