Skip to content

Commit 87f3da9

Browse files
author
Sebastian McKenzie
authored
Warn when a shrinkwrap exists in the cwd (#397)
* warn when a shrinkwrap exists in the cwd - fixes #396 * Wrap TODO with brackets
1 parent b52b7c5 commit 87f3da9

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/cli/commands/install.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ export class Install {
199199
// remove integrity hash to make this operation atomic
200200
await fs.unlink(match.loc);
201201

202+
// warn if we have a shrinkwrap
203+
if (await fs.exists(path.join(this.config.cwd, 'npm-shrinkwrap.json'))) {
204+
this.reporter.error(this.reporter.lang('shrinkwrapWarning'));
205+
}
206+
202207
//
203208
let patterns = rawPatterns;
204209
let steps: Array<(curr: number, total: number) => Promise<void>> = [];

src/reporters/lang/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ let messages = {
5151
invalidHostedGitFragment: 'Invalid hosted git fragment $0.',
5252
couldntFindManifestIn: "Couldn't find manifest in $0.",
5353
invalidFragment: 'Invalid fragment $0.',
54+
shrinkwrapWarning: 'npm-shrinkwrap.json found. This will not be updated or respected. See [TODO] for more information.',
5455

5556
commandNotSpecified: 'No command specified.',
5657
possibleCommands: 'Possible commands',

0 commit comments

Comments
 (0)