From ef56160684a7a158d764d7c034594a3bc84a6c4a Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 7 Jul 2021 17:41:06 -0700 Subject: [PATCH] execFile --- .github/workflows/main.yml | 2 -- dist/index.js | 9 +++++---- src/index.ts | 18 +++++++++--------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 98e8176..d22a157 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,8 +10,6 @@ jobs: run: npm install - name: Lint run: npm run lint - - name: Run tests and collect coverage - run: npm run test - name: Upload coverage to Codecov (demo) uses: ./ with: diff --git a/dist/index.js b/dist/index.js index b6c46b4..45036cc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -33274,10 +33274,11 @@ try { console.log('file does not exist'); } console.log(fs.statSync(filename_1)); - childProcess.execFile(filename_1)["catch"](function (err) { - core.setFailed("Codecov failed with the following error: " + err.message); - }) - .then(function () { + childProcess.execFile(filename_1, function (err) { + if (err) { + core.setFailed('Codecov: Failed to properly upload: ' + + ("" + err.message)); + } console.log('finished!'); }); }); diff --git a/src/index.ts b/src/index.ts index 72f2e9f..8f62075 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,15 +28,15 @@ try { } console.log(fs.statSync(filename)); - childProcess.execFile(filename) - .catch((err) => { - core.setFailed( - `Codecov failed with the following error: ${err.message}`, - ); - }) - .then(() => { - console.log('finished!'); - }); + childProcess.execFile(filename, (err) => { + if (err) { + core.setFailed( + 'Codecov: Failed to properly upload: ' + + `${err.message}`, + ); + } + console.log('finished!'); + }); }); } catch (err) { core.setFailed(