-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
1b983b0
commit cbd2c14
Showing
5 changed files
with
19 additions
and
12 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
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
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
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
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 |
---|---|---|
@@ -1,23 +1,30 @@ | ||
const fs = require("fs"); | ||
const semver = require("semver"); | ||
const path = require("path"); | ||
const fs = require('fs'); | ||
const semver = require('semver'); | ||
const path = require('path'); | ||
|
||
// Get the version argument from the command line | ||
const [, , version] = process.argv; | ||
|
||
if (!semver.valid(version)) { | ||
console.error( | ||
"Invalid version. The format should be X.X.X where X is a positive integer (or 0)." | ||
'Invalid version. The format should be X.X.X where X is a positive integer (or 0).', | ||
); | ||
process.exit(1); | ||
} | ||
|
||
const FrontPackageJson = path.join(__dirname, "../twenty-front/package.json"); | ||
const ServerPackageJson = path.join(__dirname, "../twenty-server/package.json"); | ||
const frontPackageJson = path.join(__dirname, '../twenty-front/package.json'); | ||
const serverPackageJson = path.join(__dirname, '../twenty-server/package.json'); | ||
const docsPackageJson = path.join(__dirname, '../twenty-docs/package.json'); | ||
const emailPackageJson = path.join(__dirname, '../twenty-emails/package.json'); | ||
|
||
// Update package.json | ||
for (let file of [FrontPackageJson, ServerPackageJson]) { | ||
for (let file of [ | ||
frontPackageJson, | ||
serverPackageJson, | ||
docsPackageJson, | ||
emailPackageJson, | ||
]) { | ||
let pkgdata = JSON.parse(fs.readFileSync(file)); | ||
pkgdata.version = version; | ||
fs.writeFileSync(file, JSON.stringify(pkgdata, null, 2), "utf8"); | ||
fs.writeFileSync(file, JSON.stringify(pkgdata, null, 2), 'utf8'); | ||
} |