Skip to content

Commit bab5253

Browse files
authored
Merge pull request #33 from AztecProtocol/jc/update-readme-version
Update README on version updates
2 parents 69a421d + 5ae7764 commit bab5253

File tree

3 files changed

+31
-9
lines changed

3 files changed

+31
-9
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { readFileSync, writeFileSync } from 'fs';
2+
import { dirname } from 'path';
3+
import { fileURLToPath } from 'url';
4+
5+
// Read Nargo.toml
6+
const nargoContent = readFileSync('Nargo.toml', 'utf8');
7+
const versionMatch = nargoContent.match(/tag\s*=\s*"aztec-packages-v([^"]+)"/);
8+
const version = versionMatch ? versionMatch[1] : null;
9+
10+
if (!version) {
11+
console.error('Could not find version tag in Nargo.toml');
12+
process.exit(1);
13+
}
14+
15+
// Read README.md
16+
const readmePath = 'README.md';
17+
let readmeContent = readFileSync(readmePath, 'utf8');
18+
19+
// Update the aztec-up version
20+
const updatedContent = readmeContent.replace(
21+
/aztec-up \d+\.\d+\.\d+/,
22+
`aztec-up ${version}`
23+
);
24+
25+
// Write back to README
26+
writeFileSync(readmePath, updatedContent);
27+
console.log(`Updated README.md with version ${version}`);

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,10 @@ Get the sandbox, aztec-cli and other tooling with this command:
1818
bash -i <(curl -s https://install.aztec.network)
1919
```
2020

21-
Modify the toolkit version to match the version (`x.x.x`) specified in Nargo.toml with:
22-
23-
```
24-
aztec-up x.x.x
25-
```
26-
27-
or update to the latest version with:
21+
Install the correct version of the toolkit with:
2822

2923
```bash
30-
aztec-up
24+
aztec-up 0.69.1
3125
```
3226

3327
Start the sandbox with:

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"test": "yarn test:js && yarn test:nr",
1717
"test:js": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand --config jest.integration.config.json",
1818
"test:nr": "aztec test",
19-
"update": "aztec update --contract . && ./.github/scripts/update_contract.sh $(grep -oP 'tag\\s*=\\s*\"\\K[^\"]+' \"Nargo.toml\" | head -1) && yarn"
19+
"update": "aztec update --contract . && ./.github/scripts/update_contract.sh $(grep -oP 'tag\\s*=\\s*\"\\K[^\"]+' \"Nargo.toml\" | head -1) && yarn && update-readme-version",
20+
"update-readme-version": "node ./.github/scripts/update-readme-version.js"
2021
},
2122
"dependencies": {
2223
"@aztec/accounts": "0.69.1",

0 commit comments

Comments
 (0)