A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/npm/cli/commit/ecd2d23d429b2fee833e534e679cce97e4190b1b below:

don't go into global mode if aliased to npmg (#7842) · npm/cli@ecd2d23 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+4

-9

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+4

-9

lines changed Original file line number Diff line number Diff line change

@@ -6,11 +6,6 @@ module.exports = async (process, validateEngines) => {

6 6

// leak any private CLI configs to other programs

7 7

process.title = 'npm'

8 8 9 -

// if npm is called as "npmg" or "npm_g", then run in global mode.

10 -

if (process.argv[1][process.argv[1].length - 1] === 'g') {

11 -

process.argv.splice(1, 1, 'npm', '-g')

12 -

}

13 - 14 9

// Patch the global fs module here at the app level

15 10

require('graceful-fs').gracefulify(require('node:fs'))

16 11 Original file line number Diff line number Diff line change

@@ -35,16 +35,16 @@ const cliMock = async (t, opts) => {

35 35

}

36 36

}

37 37 38 -

t.test('print the version, and treat npm_g as npm -g', async t => {

38 +

t.test('print the version ', async t => {

39 39

const { logs, cli, Npm, outputs, exitHandlerCalled } = await cliMock(t, {

40 -

globals: { 'process.argv': ['node', 'npm_g', 'root'] },

40 +

globals: { 'process.argv': ['node', 'npm', 'root'] },

41 41

})

42 42

await cli(process)

43 43 44 -

t.strictSame(process.argv, ['node', 'npm', '-g', 'root'], 'system process.argv was rewritten')

44 +

t.strictSame(process.argv, ['node', 'npm', 'root'], 'system process.argv was rewritten')

45 45

t.strictSame(logs.verbose.byTitle('cli'), ['cli node npm'])

46 46

t.strictSame(logs.verbose.byTitle('title'), ['title npm root'])

47 -

t.match(logs.verbose.byTitle('argv'), ['argv "--global" "root"'])

47 +

t.match(logs.verbose.byTitle('argv'), ['argv "root"'])

48 48

t.strictSame(logs.info, [`using npm@${Npm.version}`, `using node@${process.version}`])

49 49

t.equal(outputs.length, 1)

50 50

t.match(outputs[0], dirname(process.cwd()))

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4