mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(deploy): update deploy version script
This commit is contained in:
19
packages/angular/scripts/set-version.js
vendored
Normal file
19
packages/angular/scripts/set-version.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const packageJsonPath = path.join(__dirname, '../package.json');
|
||||
const packageLockPath = path.join(__dirname, '../package-lock.json');
|
||||
|
||||
|
||||
function getVersion() {
|
||||
return process.argv[process.argv.length - 1];
|
||||
}
|
||||
|
||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
||||
packageJson.version = getVersion();
|
||||
|
||||
const packageLock = JSON.parse(fs.readFileSync(packageLockPath, 'utf-8'));
|
||||
packageLock.version = packageJson.version;
|
||||
|
||||
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
|
||||
fs.writeFileSync(packageLockPath, JSON.stringify(packageLock, null, 2) + '\n');
|
||||
@@ -50,6 +50,7 @@
|
||||
"lint": "npm run tslint & npm run sass-lint",
|
||||
"prepare.deploy": "node scripts/deploy.js --prepare",
|
||||
"sass-lint": "sass-lint -v -q",
|
||||
"set.version": "node scripts/set-version.js",
|
||||
"snapshot": "node ./scripts/e2e --snapshot",
|
||||
"test": "jest --no-cache",
|
||||
"test.watch": "jest --watch --no-cache",
|
||||
|
||||
19
packages/core/scripts/set-version.js
Normal file
19
packages/core/scripts/set-version.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const packageJsonPath = path.join(__dirname, '../package.json');
|
||||
const packageLockPath = path.join(__dirname, '../package-lock.json');
|
||||
|
||||
|
||||
function getVersion() {
|
||||
return process.argv[process.argv.length - 1];
|
||||
}
|
||||
|
||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
||||
packageJson.version = getVersion();
|
||||
|
||||
const packageLock = JSON.parse(fs.readFileSync(packageLockPath, 'utf-8'));
|
||||
packageLock.version = packageJson.version;
|
||||
|
||||
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
|
||||
fs.writeFileSync(packageLockPath, JSON.stringify(packageLock, null, 2) + '\n');
|
||||
Reference in New Issue
Block a user