Skip to content

Commit

Permalink
Merge pull request #3 from ryoppippi/feature/remove-awk-sed
Browse files Browse the repository at this point in the history
feat: replace awk and sed with fish builtin string manipulation
  • Loading branch information
ryoppippi authored May 20, 2024
2 parents c9534aa + 9a4c248 commit 1d704dc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
## Requirements
- fish shell
- fzf (or your favorite fuzzy finder such as peco, skim, etc.)
- awk
- sed

## Install

Expand Down
2 changes: 1 addition & 1 deletion functions/_na.fish
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function _na_get_package_manager_name --argument-names path
end

if test -n "$package_json_path"
set package_manager_name (awk -F\" '/"packageManager"/{print $4}' $package_json_path | sed -e 's/@.*//')
set package_manager_name (cat $package_json_path | string match --entire -r "packageManager" | string replace -r '.*"packageManager": "' '' | string split @)[1]
if test -n "$package_manager_name"
if contains $package_manager_name [npm yarn pnpm bun]
echo $package_manager_name
Expand Down

0 comments on commit 1d704dc

Please sign in to comment.