8000 fix: interactive updates with --latest, close #44 (#46) · antfu-collective/ni@dde0ac5 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit dde0ac5

Browse files
authored
fix: interactive updates with --latest, close #44 (#46)
1 parent 563d343 commit dde0ac5

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

src/agents.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const AGENTS = {
2424
'global': 'yarn global add {0}',
2525
'add': 'yarn add {0}',
2626
'upgrade': 'yarn upgrade {0}',
27-
'upgrade-interactive': 'yarn upgrade-interactive',
27+
'upgrade-interactive': 'yarn upgrade-interactive {0}',
2828
'execute': 'yarn dlx {0}',
2929
'uninstall': 'yarn remove {0}',
3030
'global_uninstall': 'yarn global remove {0}',
@@ -36,7 +36,7 @@ export const AGENTS = {
3636
'global': 'pnpm i -g {0}',
3737
'add': 'pnpm i {0}',
3838
'upgrade': 'pnpm update {0}',
39-
'upgrade-interactive': 'pnpm update -i',
39+
'upgrade-interactive': 'pnpm update -i {0}',
4040
'execute': 'pnpm dlx {0}',
4141
'uninstall': 'pnpm remove {0}',
4242
'global_uninstall': 'pnpm remove -g {0}',

test/nu/npm.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import test, { ExecutionContext } from 'ava'
2+
import { parseNu } from '../../src/commands'
3+
4+
const agent = 'npm'
5+
const _ = (arg: string, expected: string) => (t: ExecutionContext) => {
6+
t.is(
7+
parseNu(agent, arg.split(' ').filter(Boolean)),
8+
expected,
9+
)
10+
}
11+
12+
test('empty', _('', 'npm update'))

test/nu/pnpm.spec.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import test, { ExecutionContext } from 'ava'
2+
import { parseNu } from '../../src/commands'
3+
4+
const agent = 'pnpm'
5+
const _ = (arg: string, expected: string) => (t: ExecutionContext) => {
6+
t.is(
7+
parseNu(agent, arg.split(' ').filter(Boolean)),
8+
expected,
9+
)
10+
}
11+
12+
test('empty', _('', 'pnpm update'))
13+
14+
test('interactive', _('-i', 'pnpm update -i'))
15+
16+
test('interactive latest', _('-i --latest', 'pnpm update -i --latest'))

test/nu/yarn.spec.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import test, { ExecutionContext } from 'ava'
2+
import { parseNu } from '../../src/commands'
3+
4+
const agent = 'yarn'
5+
const _ = (arg: string, expected: string) => (t: ExecutionContext) => {
6+
t.is(
7+
parseNu(agent, arg.split(' ').filter(Boolean)),
8+
expected,
9+
)
10+
}
11+
12+
test('empty', _('', 'yarn upgrade'))
13+
14+
test('interactive', _('-i', 'yarn upgrade-interactive'))
15+
16+
test('interactive latest', _('-i --latest', 'yarn upgrade-interactive --latest'))

0 commit comments

Comments
 (0)
0