Browse Source

npmsearch: pass arguments to fzf when removing

DanielFGray 1 year ago
parent
commit
d192bd217c
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      npmsearch

+ 2
- 1
npmsearch View File

@@ -80,9 +80,10 @@ if [[ $1 = '-h' || $1 = '--help' ]]; then
80 80
 fi
81 81
 
82 82
 if [[ $1 = '-r' || $1 = '--remove' ]]; then
83
+  shift
83 84
   mapfile -t rm < <(
84 85
     jq -r '{dependencies, devDependencies} | .[] | keys | .[]' package.json |
85
-      fzf -m --cycle -e --reverse)
86
+      fzf -m --cycle -e --reverse --query="$*")
86 87
     (( ${#rm} > 0 )) && $(select_from 'yarn remove' 'npm uninstall') "${rm[@]}"
87 88
   die
88 89
 fi

Loading…
Cancel
Save