Skip to content

Commit

Permalink
Make it work with Fish 3.0
Browse files Browse the repository at this point in the history
Need to replace all usage of `math` with `test`, which should work on all fish versions.
  • Loading branch information
swsnider authored Feb 11, 2019
1 parent 5ab8dae commit 144ad39
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dtags/shells/fish.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
set _dtags_choice "{choice}"
set -g _dtags_prompt "{prompt}"
end
if math "1 >" (count $argv) > /dev/null
if [ 1 -gt (count $argv) ] > /dev/null
cd $HOME
return 0
else if [ $argv[1] = "--help" ]
Expand All @@ -52,20 +52,20 @@
else if echo "$argv[1]" | grep -q -E '^-' > /dev/null
printf "$_dtags_arg_err" "$_dtags_usage" "$argv[1]"
return 2
else if math "1 <" (count $argv) > /dev/null
else if [ 1 -lt (count $argv) ] > /dev/null
printf "%sd: too many arguments\n" "$_dtags_usage"
return 2
end
set _dtags_dirs (grep -F ,$argv[1], {mapping_file} | cut -d',' -f1)
set -g _dtags_count (count $_dtags_dirs)
if math "$_dtags_count == 0" > /dev/null
if [ $_dtags_count -eq 0 ] > /dev/null
if test -d $argv[1]
set _dtags_dir $argv[1]
else
printf "$_dtags_dest_err" "$argv[1]"
return 2
end
else if math "$_dtags_count == 1" > /dev/null
else if [ $_dtags_count -eq 1 ] > /dev/null
set _dtags_dir $_dtags_dirs[1]
else
for i in (seq $_dtags_count)
Expand All @@ -79,7 +79,7 @@
if not echo "$_dtags_idx" | grep -q -E '^[0-9]+$' > /dev/null
printf "$_dtags_input_err" "$_dtags_idx"
return 2
else if math "$_dtags_idx > $_dtags_count" > /dev/null
else if [ $_dtags_idx -gt $_dtags_count ] > /dev/null
printf "$_dtags_idx_err" "$_dtags_idx"
return 2
end
Expand Down

0 comments on commit 144ad39

Please sign in to comment.