Skip to content

Commit

Permalink
llint
Browse files Browse the repository at this point in the history
  • Loading branch information
ruddell committed Oct 19, 2020
1 parent efdc692 commit f5062d5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/lib/merge-package-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
const replacePackageJsonVersions = async (context, packageJsonWithTemplatedVersions, packageJsonWithVersionsFile) => {
try {
const fs = require('fs-extra')
const packageJsonWithVersions = await fs.readJSON(packageJsonWithVersionsFile);
const packageJsonWithVersions = await fs.readJSON(packageJsonWithVersionsFile)
const replace = section => {
if (packageJsonWithTemplatedVersions[section]) {
Object.entries(packageJsonWithTemplatedVersions[section]).forEach(([dependency, dependencyReference]) => {
Expand All @@ -33,21 +33,21 @@ const replacePackageJsonVersions = async (context, packageJsonWithTemplatedVersi
keyToReplaceAtSource,
sectionAtSource = section,
dependencyAtSource = dependency,
] = dependencyReference.split('#');
if (keyToReplaceAtSource !== 'REPLACE_WITH_VERSION') return;
] = dependencyReference.split('#')
if (keyToReplaceAtSource !== 'REPLACE_WITH_VERSION') return
if (!packageJsonWithVersions[sectionAtSource] || !packageJsonWithVersions[sectionAtSource][dependencyAtSource]) {
throw new Error(
`Error setting ${dependencyAtSource} version, not found at ${sectionAtSource}.${dependencyAtSource}`
);
)
}
packageJsonWithTemplatedVersions[section][dependency] = packageJsonWithVersions[sectionAtSource][dependencyAtSource];
packageJsonWithTemplatedVersions[section][dependency] = packageJsonWithVersions[sectionAtSource][dependencyAtSource]
}
});
})
}
};
replace('dependencies');
replace('devDependencies');
return packageJsonWithTemplatedVersions;
}
replace('dependencies')
replace('devDependencies')
return packageJsonWithTemplatedVersions
} catch (err) {
console.error(err)
process.exit(1)
Expand Down

0 comments on commit f5062d5

Please sign in to comment.