From 6686b22579df9e6668acf0147739f9cab8bafab2 Mon Sep 17 00:00:00 2001 From: Adam Bergman Date: Thu, 14 Dec 2017 23:17:28 +0100 Subject: [PATCH] fix(travis-after-success): Update when to run semantic-release dry run --- .../travis-after-success.js.snap | 6 +++--- src/scripts/travis-after-success.js | 19 ++----------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/scripts/__tests__/__snapshots__/travis-after-success.js.snap b/src/scripts/__tests__/__snapshots__/travis-after-success.js.snap index 61b5f06..2e938bb 100644 --- a/src/scripts/__tests__/__snapshots__/travis-after-success.js.snap +++ b/src/scripts/__tests__/__snapshots__/travis-after-success.js.snap @@ -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'"`; @@ -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., ], ] `; diff --git a/src/scripts/travis-after-success.js b/src/scripts/travis-after-success.js index 3ec83ae..4e2ffda 100644 --- a/src/scripts/travis-after-success.js +++ b/src/scripts/travis-after-success.js @@ -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'), @@ -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 }, ),