Skip to content

Commit 45890fd

Browse files
committed
fix: return false if the npm publish is skipped
1 parent bd16cfb commit 45890fd

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lib/publish.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ module.exports = async ({npmPublish, pkgRoot}, pkg, context) => {
3232
logger.log(`Published ${pkg.name}@${pkg.version} on ${registry}`);
3333
return getReleaseInfo(pkg, context, registry);
3434
}
35+
3536
logger.log(
3637
'Skip publishing to npm registry as %s is %s',
3738
...(npmPublish === false ? ['npmPublish', false] : ["package.json's private property", true])
3839
);
40+
41+
return false;
3942
};

test/integration.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ test('Create the package and skip publish ("npmPublish" is false)', async t => {
329329
}
330330
);
331331

332-
t.falsy(result);
332+
t.false(result);
333333
t.is((await readJson(path.resolve(cwd, 'package.json'))).version, '1.0.0');
334334
t.true(await pathExists(path.resolve(cwd, `tarball/${pkg.name}-1.0.0.tgz`)));
335335
await t.throws(execa('npm', ['view', pkg.name, 'version'], {cwd, env: testEnv}));
@@ -354,7 +354,7 @@ test('Create the package and skip publish ("package.private" is true)', async t
354354
}
355355
);
356356

357-
t.falsy(result);
357+
t.false(result);
358358
t.is((await readJson(path.resolve(cwd, 'package.json'))).version, '1.0.0');
359359
t.true(await pathExists(path.resolve(cwd, `tarball/${pkg.name}-1.0.0.tgz`)));
360360
await t.throws(execa('npm', ['view', pkg.name, 'version'], {cwd, env: testEnv}));
@@ -379,7 +379,7 @@ test('Create the package and skip publish from a sub-directory ("npmPublish" is
379379
}
380380
);
381381

382-
t.falsy(result);
382+
t.false(result);
383383
t.is((await readJson(path.resolve(cwd, 'dist/package.json'))).version, '1.0.0');
384384
t.true(await pathExists(path.resolve(cwd, `tarball/${pkg.name}-1.0.0.tgz`)));
385385
await t.throws(execa('npm', ['view', pkg.name, 'version'], {cwd, env: testEnv}));
@@ -409,7 +409,7 @@ test('Create the package and skip publish from a sub-directory ("package.private
409409
}
410410
);
411411

412-
t.falsy(result);
412+
t.false(result);
413413
t.is((await readJson(path.resolve(cwd, 'dist/package.json'))).version, '1.0.0');
414414
t.true(await pathExists(path.resolve(cwd, `tarball/${pkg.name}-1.0.0.tgz`)));
415415
await t.throws(execa('npm', ['view', pkg.name, 'version'], {cwd, env: testEnv}));

0 commit comments

Comments
 (0)