Skip to content

Commit

Permalink
fix(yarn): use yarn up --interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Sep 12, 2023
1 parent 4de0f8f commit f2c2fe9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ ni dlx <pkg> -- download package and execute command
| `ni run <script>` | `npm run` | `yarn run` | `yarn run` | `pnpm run` | `bun run` |
| `ni test` | `npm run test` | `yarn run test` | `yarn run test` | `pnpm run test` | `bun run test` |
| `ni upgrade` | `npm upgrade` | `yarn upgrade` | `yarn up` | `pnpm update` | `bun update` |
| `ni upgrade-interactive` | `npm-check`**^1** | `yarn upgrade-interactive` | `yarn upgrade-interactive` | `pnpm update -i` ||
| `ni upgrade-interactive` | `npm-check`**^1** | `yarn up --interactive "*"` | `yarn upgrade-interactive` | `pnpm update -i` ||
| `ni exec <command>` | `npm exec --no` | `yarn <command>` | `yarn exec` | `pnpm exec` | `bunx` |
| `ni dlx <pkg>` | `npx` | `npx` | `yarn dlx` | `pnpm dlx` | `bunx` |

Expand Down
11 changes: 7 additions & 4 deletions ni.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function ni-assertPackageBySocket() {
# If input string contains '@', extract package version after the last '@'
echo "$(echo "$1" | rev | cut -d "@" -f 1 | rev)"
}

local pkg
local version
pkg=$(getPackageName "$1")
Expand Down Expand Up @@ -161,7 +161,7 @@ function ni-assertPackageBySocket() {
# });
# ```
echo -e "\033[31m$riskMessage\033[0m"
# show
# show
echo "Are you sure to install this package?[y/N]"
read yn
if [ "$yn" != "y" ]; then
Expand Down Expand Up @@ -270,7 +270,7 @@ function ni-add() {
if [[ $? -eq 1 ]]; then
return 1
fi

local manager
manager=$(ni-getPackageManager)
# normailze flag by package manager
Expand Down Expand Up @@ -389,9 +389,12 @@ function ni-upgrade-interactive(){
npm)
ni-echoRun npm-check -u
;;
yarn*)
yarn)
ni-echoRun yarn upgrade-interactive --latest
;;
yarn-berry)
ni-echoRun yarn up --interactive "*"
;;
pnpm)
ni-echoRun pnpm --recursive update -i --latest
;;
Expand Down

0 comments on commit f2c2fe9

Please sign in to comment.