Skip to content

Commit

Permalink
fix: copied box nargo toml trailing slash (#2819)
Browse files Browse the repository at this point in the history
missed this in previous update to make box buildable in monorepo(?)

double checking if correct or not,
https://aztecprotocol.slack.com/archives/C8QHBFVSA/p1695119518355949?thread_ts=1695039245.640269&cid=C8QHBFVSA
  • Loading branch information
dan-aztec authored Oct 13, 2023
1 parent 8f3e666 commit ecd2a64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion yarn-project/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,10 @@ export function getProgram(log: LogFn, debugLogger: DebugLogger): Command {
'Unboxes an example contract from @aztec/boxes. Also Copies `noir-libs` dependencies and setup simple frontend for the contract using its ABI.',
)
.argument('<contractName>', 'Name of the contract to unbox, e.g. "PrivateToken"')
.argument('[localDirectory]', 'Local directory to unbox to (relative or absolute), defaults to `<contractName>`')
.argument(
'[localDirectory]',
'Local directory to unbox source folder to (relative or absolute), optional - defaults to `<contractName>/`',
)
.action(async (contractName, localDirectory) => {
const unboxTo: string = localDirectory ? localDirectory : contractName;
await unboxContract(contractName, unboxTo, version, log);
Expand Down
7 changes: 4 additions & 3 deletions yarn-project/cli/src/unbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async function downloadContractAndBoxFromGithub(
// small string conversion, in the ABI the contract name looks like PrivateToken
// but in the repostory it looks like private_token

log(`Downloading @aztex/boxes/${contractName}/ to ${outputPath}...`);
log(`Downloading @aztec/boxes/${contractName}/ to ${outputPath}...`);
// Step 1: Fetch the monorepo ZIP from GitHub, matching the CLI version
const url = `https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/archive/refs/tags/${tag}.zip`;
const response = await fetch(url);
Expand Down Expand Up @@ -176,8 +176,9 @@ async function updateNargoToml(tag: string, outputPath: string, log: LogFn): Pro
line.trim().startsWith(`${dependencyName} =`),
);
if (key) {
// Replace the line
return `${key} = { git="https://github.com/AztecProtocol/aztec-packages", tag="${tag}", directory="yarn-project/aztec-nr/${key}" }`;
// Replace the line, which was configured for compiling within the `aztec-packages` monorepo. We replace
// the local path with `git` and `directory` fields with a `tag` field, which points to the tagged release
return `${key} = { git="https://github.com/AztecProtocol/aztec-packages/", tag="${tag}", directory="yarn-project/aztec-nr/${key}" }`;
}
return line;
});
Expand Down

0 comments on commit ecd2a64

Please sign in to comment.