mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-21 03:04:32 +00:00
fix: handle already-exists error during crate publish
This commit is contained in:
parent
2b419f9e40
commit
f0810b0541
1 changed files with 11 additions and 2 deletions
|
|
@ -116,12 +116,21 @@ export async function publishCrates(opts: ReleaseOpts) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await $({
|
await $({
|
||||||
stdio: "inherit",
|
stdout: "pipe",
|
||||||
|
stderr: "pipe",
|
||||||
cwd: cratePath,
|
cwd: cratePath,
|
||||||
})`cargo publish --allow-dirty --no-verify`;
|
})`cargo publish --allow-dirty --no-verify`;
|
||||||
console.log(`✅ Published ${crateName}@${opts.version}`);
|
console.log(`✅ Published ${crateName}@${opts.version}`);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
|
// Check if error is because crate already exists (from a previous partial run)
|
||||||
|
if (err.stderr?.includes("already exists")) {
|
||||||
|
console.log(
|
||||||
|
`Version ${opts.version} of ${crateName} already exists on crates.io. Skipping...`,
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
console.error(`❌ Failed to publish ${crateName}`);
|
console.error(`❌ Failed to publish ${crateName}`);
|
||||||
|
console.error(err.stderr || err.message);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue