Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: allow passing custom tmpdir #107

Merged
merged 15 commits into from
Aug 26, 2024
5 changes: 5 additions & 0 deletions .changeset/fuzzy-mayflies-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@axelar-network/axelar-cgp-sui': patch
---

allow passing custom tmpdir to avoid error on some dev environment
13 changes: 9 additions & 4 deletions src/tx-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,15 @@ export class TxBuilder {
const tmpobj = tmp.dirSync({ unsafeCleanup: true });
milapsheth marked this conversation as resolved.
Show resolved Hide resolved

const { modules, dependencies, digest } = JSON.parse(
execSync(`sui move build --dump-bytecode-as-base64 --path ${path.join(moveDir, packageName)} --install-dir ${tmpobj.name}`, {
encoding: 'utf-8',
stdio: 'pipe', // silent the output
}),
execSync(
`sui move build --dump-bytecode-as-base64 --path ${path.join(moveDir, packageName)} --install-dir ${
process.env.SUI_TMPDIR || tmpobj.name
}`,
{
encoding: 'utf-8',
stdio: 'pipe', // silent the output
},
),
);

return { modules, dependencies, digest };
Expand Down
Loading