Skip to content

Commit

Permalink
fix yarnpkg#1684 prefer --modules-folder
Browse files Browse the repository at this point in the history
  • Loading branch information
nifgraup committed Nov 18, 2016
1 parent 328b4e1 commit 33b3cc4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/cli/commands/install.js
Expand Up @@ -590,19 +590,19 @@ export class Install {
const possibleFolders = [];
if (this.config.modulesFolder) {
possibleFolders.push(this.config.modulesFolder);
}

// get a list of registry names to check existence in
let checkRegistryNames = this.resolver.usedRegistries;
if (!checkRegistryNames.length) {
// we haven't used any registries yet
checkRegistryNames = registryNames;
}
} else {
// get a list of registry names to check existence in
let checkRegistryNames = this.resolver.usedRegistries;
if (!checkRegistryNames.length) {
// we haven't used any registries yet
checkRegistryNames = registryNames;
}

// ensure we only write to a registry folder that was used
for (const name of checkRegistryNames) {
const loc = path.join(this.config.cwd, this.config.registries[name].folder);
possibleFolders.push(loc);
// ensure we only write to a registry folder that was used
for (const name of checkRegistryNames) {
const loc = path.join(this.config.cwd, this.config.registries[name].folder);
possibleFolders.push(loc);
}
}

// if we already have an integrity hash in one of these folders then use it's location otherwise use the
Expand Down

0 comments on commit 33b3cc4

Please sign in to comment.