-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nightly build schedule and update dev version in prebuild script (#…
…121)
- Loading branch information
Showing
2 changed files
with
67 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const exec = require("child_process").exec; | ||
const process = require("process"); | ||
|
||
const PACKAGE_JSON_PATH = path.resolve(__dirname, "../package.json"); | ||
const CMD = "npm view kuzu@next version"; | ||
|
||
(() => { | ||
exec(CMD, (error, stdout, _) => { | ||
if (error) { | ||
console.error(`Failed to get latest dev version: ${error}`); | ||
process.exit(1); | ||
} | ||
const latestVersion = stdout.trim(); | ||
console.log(`Latest dev version is ${latestVersion}`); | ||
fs.readFile(PACKAGE_JSON_PATH, "utf8", (err, data) => { | ||
console.log("Opened package.json at", PACKAGE_JSON_PATH); | ||
if (err) { | ||
console.error("Error reading package.json", err); | ||
process.exit(1); | ||
} | ||
const packageJson = JSON.parse(data); | ||
packageJson.dependencies.kuzu = `^${latestVersion}`; | ||
fs.writeFile( | ||
PACKAGE_JSON_PATH, | ||
JSON.stringify(packageJson, null, 2), | ||
(err) => { | ||
if (err) { | ||
console.error("Error writing package.json", err); | ||
process.exit(1); | ||
} | ||
console.log(`Updated kuzu to ${latestVersion}`); | ||
process.exit(0); | ||
} | ||
); | ||
}); | ||
}); | ||
})(); |