Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
fix(travis-after-success): Update when to run semantic-release dry run
Browse files Browse the repository at this point in the history
  • Loading branch information
adambrgmn committed Dec 14, 2017
1 parent 5d528cd commit 6686b22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

exports[`travis-after-success calls concurrently with both scripts when on travis 1`] = `concurrently --prefix [{name}] --names codecov,release --prefix-colors bgBlue.bold.reset,bgGreen.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'" "echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release'"`;

exports[`travis-after-success does not do autorelease script when running on travis but in a pull request 1`] = `concurrently --prefix [{name}] --names codecov --prefix-colors bgBlue.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'"`;
exports[`travis-after-success does not do autorelease script when running on travis but in a pull request 1`] = `concurrently --prefix [{name}] --names codecov,release --prefix-colors bgBlue.bold.reset,bgGreen.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'" "echo running semantic-release dry-run && echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release --dry-run'"`;

exports[`travis-after-success does not do the autorelease script when the version is different 1`] = `concurrently --prefix [{name}] --names codecov --prefix-colors bgBlue.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'"`;
exports[`travis-after-success does not do the autorelease script when the version is different 1`] = `concurrently --prefix [{name}] --names codecov,release --prefix-colors bgBlue.bold.reset,bgGreen.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'" "echo running semantic-release dry-run && echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release --dry-run'"`;

exports[`travis-after-success does not do the codecov script when opted out 1`] = `concurrently --prefix [{name}] --names release --prefix-colors bgBlue.bold.reset "echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release'"`;

Expand All @@ -13,7 +13,7 @@ exports[`travis-after-success does not do the codecov script when there is no co
exports[`travis-after-success does not run either script when no coverage dir and not the right version 1`] = `
Array [
Array [
No need to autorelease or report coverage. Running semantic-release dry-run,
No need to autorelease or report coverage.,
],
]
`;
19 changes: 2 additions & 17 deletions src/scripts/travis-after-success.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,7 @@ const autorelease =
const reportCoverage = hasFile('coverage') && !parseEnv('SKIP_CODECOV', false);

if (!autorelease && !reportCoverage) {
console.log(
'No need to autorelease or report coverage. Running semantic-release dry-run',
);

const result = spawn.sync(
resolveBin('concurrently'),
getConcurrentlyArgs(
{
release: `echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release --dry-run'`,
},
{ killOthers: false },
),
{ stdio: 'inherit' },
);

process.exit(result.status);
console.log('No need to autorelease or report coverage.');
} else {
const result = spawn.sync(
resolveBin('concurrently'),
Expand All @@ -42,7 +27,7 @@ if (!autorelease && !reportCoverage) {
: null,
release: autorelease
? `echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release'`
: null,
: `echo running semantic-release dry-run && echo installing semantic-release && npx -p semantic-release@11 -c 'echo running semantic-release && semantic-release --dry-run'`,
},
{ killOthers: false },
),
Expand Down

0 comments on commit 6686b22

Please sign in to comment.