update package-lock.json in gulp task

This commit is contained in:
Johannes Loher 2021-01-09 18:40:52 +01:00
parent f5d52825e8
commit e99906a18a
2 changed files with 3 additions and 1 deletions

View file

@ -85,7 +85,6 @@ release-patch:
git branch -D ci-processing || true git branch -D ci-processing || true
git checkout -b ci-processing git checkout -b ci-processing
npm run updateManifest -- --update=${RELEASE_TYPE} npm run updateManifest -- --update=${RELEASE_TYPE}
npm install
RELEASE_VERSION=$(jq -r '.version' < package.json) RELEASE_VERSION=$(jq -r '.version' < package.json)
git add package.json package-lock.json src/system.json git add package.json package-lock.json src/system.json
git --no-pager diff git --no-pager diff

View file

@ -262,6 +262,7 @@ async function linkUserData() {
*/ */
function updateManifest(cb) { function updateManifest(cb) {
const packageJson = fs.readJSONSync("package.json"); const packageJson = fs.readJSONSync("package.json");
const packageLockJson = fs.readJSONSync("package-lock.json");
const manifest = getManifest(); const manifest = getManifest();
if (!manifest) cb(Error(chalk.red("Manifest JSON not found"))); if (!manifest) cb(Error(chalk.red("Manifest JSON not found")));
@ -306,6 +307,7 @@ function updateManifest(cb) {
console.log(`Updating version number to '${targetVersion}'`); console.log(`Updating version number to '${targetVersion}'`);
packageJson.version = targetVersion; packageJson.version = targetVersion;
packageLockJson.version = targetVersion;
manifest.file.version = targetVersion; manifest.file.version = targetVersion;
/* Update URL */ /* Update URL */
@ -320,6 +322,7 @@ function updateManifest(cb) {
}) + "\n"; }) + "\n";
fs.writeJSONSync("package.json", packageJson, { spaces: 4 }); fs.writeJSONSync("package.json", packageJson, { spaces: 4 });
fs.writeJSONSync("package-lock.json", packageLockJson, { spaces: 4 });
fs.writeFileSync(path.join(manifest.root, manifest.name), prettyProjectJson, "utf8"); fs.writeFileSync(path.join(manifest.root, manifest.name), prettyProjectJson, "utf8");
return cb(); return cb();