mirror of
https://github.com/napi-rs/napi-rs.git
synced 2025-12-08 19:56:07 +00:00
chore(cli): skip already published native packages (#2874)
Allow to retry failed CI jobs
This commit is contained in:
parent
fe57c05d6b
commit
db82372302
@ -165,10 +165,26 @@ export async function prePublish(userOptions: PrePublishOptions) {
|
||||
}
|
||||
|
||||
if (!options.skipOptionalPublish) {
|
||||
execSync(`${npmClient} publish`, {
|
||||
cwd: pkgDir,
|
||||
env: process.env,
|
||||
})
|
||||
try {
|
||||
const output = execSync(`${npmClient} publish`, {
|
||||
cwd: pkgDir,
|
||||
env: process.env,
|
||||
stdio: 'pipe',
|
||||
})
|
||||
process.stdout.write(output)
|
||||
} catch (e) {
|
||||
if (
|
||||
e instanceof Error &&
|
||||
e.message.includes(
|
||||
'You cannot publish over the previously published versions',
|
||||
)
|
||||
) {
|
||||
console.info(e.message)
|
||||
debug.warn(`${pkgDir} has been published, skipping`)
|
||||
} else {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (options.ghRelease && repo && owner) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user