Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
refactor: options are before the package names in the installation co…
Browse files Browse the repository at this point in the history
…mmands
  • Loading branch information
zkochan committed May 7, 2016
1 parent b032cad commit 7833f9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/render-installation.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function createCommand (opts) {
}
const installedPkgs = Object.keys(opts.pkg.peerDependencies || {}).concat(opts.pkg.name).join(' ')
if (opts.pkg.preferDev) {
return `npm ${commands.install} ${installedPkgs} ${commands.saveDev}`
return `npm ${commands.install} ${commands.saveDev} ${installedPkgs}`
}
return `npm ${commands.install} ${installedPkgs} ${opts.pkg.preferGlobal ? commands.global : commands.save}`
return `npm ${commands.install} ${opts.pkg.preferGlobal ? commands.global : commands.save} ${installedPkgs}`
}
14 changes: 7 additions & 7 deletions lib/render-installation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('createInstallation', () => {
]),
code({
lang: 'sh',
value: 'npm install foo --global',
value: 'npm install --global foo',
}),
])
})
Expand All @@ -43,7 +43,7 @@ describe('createInstallation', () => {
]),
code({
lang: 'sh',
value: 'npm install foo --save-dev',
value: 'npm install --save-dev foo',
}),
])
})
Expand All @@ -61,7 +61,7 @@ describe('createInstallation', () => {
]),
code({
lang: 'sh',
value: 'npm install foo --save',
value: 'npm install --save foo',
}),
])
})
Expand Down Expand Up @@ -129,7 +129,7 @@ describe('createInstallation', () => {
]),
code({
lang: 'sh',
value: 'npm install bar qar foo --save',
value: 'npm install --save bar qar foo',
}),
])
})
Expand All @@ -148,7 +148,7 @@ describe('createInstallation', () => {
]),
code({
lang: 'sh',
value: 'npm i foo -g',
value: 'npm i -g foo',
}),
])
})
Expand All @@ -167,7 +167,7 @@ describe('createInstallation', () => {
]),
code({
lang: 'sh',
value: 'npm i foo -D',
value: 'npm i -D foo',
}),
])
})
Expand All @@ -185,7 +185,7 @@ describe('createInstallation', () => {
]),
code({
lang: 'sh',
value: 'npm i foo -S',
value: 'npm i -S foo',
}),
])
})
Expand Down

0 comments on commit 7833f9a

Please sign in to comment.