Skip to content

Commit

Permalink
Warn when a shrinkwrap exists in the cwd (#397)
Browse files Browse the repository at this point in the history
* warn when a shrinkwrap exists in the cwd - fixes #396

* Wrap TODO with brackets
  • Loading branch information
Sebastian McKenzie committed Sep 21, 2016
1 parent b52b7c5 commit 87f3da9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cli/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ export class Install {
// remove integrity hash to make this operation atomic
await fs.unlink(match.loc);

// warn if we have a shrinkwrap
if (await fs.exists(path.join(this.config.cwd, 'npm-shrinkwrap.json'))) {
this.reporter.error(this.reporter.lang('shrinkwrapWarning'));
}

//
let patterns = rawPatterns;
let steps: Array<(curr: number, total: number) => Promise<void>> = [];
Expand Down
1 change: 1 addition & 0 deletions src/reporters/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ let messages = {
invalidHostedGitFragment: 'Invalid hosted git fragment $0.',
couldntFindManifestIn: "Couldn't find manifest in $0.",
invalidFragment: 'Invalid fragment $0.',
shrinkwrapWarning: 'npm-shrinkwrap.json found. This will not be updated or respected. See [TODO] for more information.',

commandNotSpecified: 'No command specified.',
possibleCommands: 'Possible commands',
Expand Down

0 comments on commit 87f3da9

Please sign in to comment.