-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68792b6
commit 4e1ab97
Showing
6 changed files
with
62 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { execSync } = require('child_process'); | ||
|
||
const rootPackagePath = path.join(__dirname, '..', '..', 'package.json'); | ||
const appPackagePath = path.join( | ||
__dirname, | ||
'..', | ||
'..', | ||
'release', | ||
'app', | ||
'package.json', | ||
); | ||
|
||
function updateVersion(type) { | ||
// Update root package.json | ||
execSync(`npm version ${type} --no-git-tag-version`); | ||
|
||
// Read the new version from root package.json | ||
const rootPackage = JSON.parse(fs.readFileSync(rootPackagePath, 'utf8')); | ||
const newVersion = rootPackage.version; | ||
|
||
// Update app package.json | ||
const appPackage = JSON.parse(fs.readFileSync(appPackagePath, 'utf8')); | ||
appPackage.version = newVersion; | ||
fs.writeFileSync(appPackagePath, JSON.stringify(appPackage, null, 2)); | ||
|
||
console.log(`Version bumped to ${newVersion}`); | ||
|
||
// Stage changes | ||
execSync('git add package.json release/app/package.json'); | ||
|
||
// Commit changes | ||
execSync(`git commit -m "Bump version to ${newVersion}"`); | ||
} | ||
|
||
const versionType = process.argv[2]; | ||
if (!['patch', 'minor', 'major'].includes(versionType)) { | ||
console.error('Please specify version type: patch, minor, or major'); | ||
process.exit(1); | ||
} | ||
|
||
updateVersion(versionType); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.