Skip to content

Commit 5fa9676

Browse files
committed
fix(local-npm): don't fail if unpublish does not work
It will be quite common that the package being published is not yet in the local npm registry, so ignore unpublish when it fails.
1 parent 4d782b3 commit 5fa9676

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

support/packages/local-npm/lib/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function publish(projects) {
9494

9595
console.log(` ${pkgId}`);
9696

97-
run('npm', 'unpublish', pkgId);
97+
run('npm', 'unpublish', pkgId, {lenient: true});
9898
run('yarn', 'cache', 'clean', pkgId);
9999
});
100100

@@ -150,6 +150,7 @@ function registrySet(which) {
150150

151151
function run(cmd, ...args) {
152152
let options = {
153+
lenient: false, // set to true to ignore error return codes
153154
shell: true,
154155
stdio: 'pipe',
155156
};
@@ -171,7 +172,7 @@ function run(cmd, ...args) {
171172
process.exit(1);
172173
}
173174

174-
if (result.status !== 0) {
175+
if (!options.lenient && result.status !== 0) {
175176
if (result.stdout) {
176177
console.error(result.stdout.toString());
177178
console.error(result.stderr.toString());

0 commit comments

Comments
 (0)