@napi-rs/cli 3.1.4 → 3.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@napi-rs/cli",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
4
4
  "description": "Cli tools for napi-rs",
5
5
  "author": "LongYinan <lynweklm@gmail.com>",
6
6
  "homepage": "https://github.com/napi-rs/napi-rs",
@@ -165,10 +165,26 @@ export async function prePublish(userOptions: PrePublishOptions) {
165
165
  }
166
166
 
167
167
  if (!options.skipOptionalPublish) {
168
- execSync(`${npmClient} publish`, {
169
- cwd: pkgDir,
170
- env: process.env,
171
- })
168
+ try {
169
+ const output = execSync(`${npmClient} publish`, {
170
+ cwd: pkgDir,
171
+ env: process.env,
172
+ stdio: 'pipe',
173
+ })
174
+ process.stdout.write(output)
175
+ } catch (e) {
176
+ if (
177
+ e instanceof Error &&
178
+ e.message.includes(
179
+ 'You cannot publish over the previously published versions',
180
+ )
181
+ ) {
182
+ console.info(e.message)
183
+ debug.warn(`${pkgDir} has been published, skipping`)
184
+ } else {
185
+ throw e
186
+ }
187
+ }
172
188
  }
173
189
 
174
190
  if (options.ghRelease && repo && owner) {