Skip to content

Commit

Permalink
The change-version script now updates wasm/Cargo.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Pauan committed Sep 27, 2024
1 parent 3813b90 commit cc0c599
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/change-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ async function updateVersions(newVersion) {
}


// Updates the version in `Cargo.toml`
async function updateCargo(newVersion) {
const json = await readFile("wasm/Cargo.toml", { encoding: "utf8" });

const replaced = json
.replace(/(name *= *"aleo-wasm"\s+version *= *)"[^"]+"/, `$1"${newVersion}"`);

await writeFile("wasm/Cargo.toml", replaced);
}


// Updates all of the `package.json` files so they use the correct
// version of `@provablehq/wasm` and `@provablehq/sdk`
async function updateDependencies(newVersion) {
Expand All @@ -51,4 +62,5 @@ async function updateDependencies(newVersion) {
const newVersion = process.argv[2];

await updateVersions(newVersion);
await updateCargo(newVersion);
await updateDependencies(newVersion);

0 comments on commit cc0c599

Please sign in to comment.