Browse Source

npmsearch: pass arguments to fzf when removing

pull/8/head
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
fi

if [[ $1 = '-r' || $1 = '--remove' ]]; then
shift
mapfile -t rm < <(
jq -r '{dependencies, devDependencies} | .[] | keys | .[]' package.json |
fzf -m --cycle -e --reverse)
fzf -m --cycle -e --reverse --query="$*")
(( ${#rm} > 0 )) && $(select_from 'yarn remove' 'npm uninstall') "${rm[@]}"
die
fi

Loading…
Cancel
Save