From 88fc2155c482f456f2aa06cc996c7be419ca3306 Mon Sep 17 00:00:00 2001 From: Niklas Gehlen Date: Wed, 6 Sep 2023 18:25:09 +0200 Subject: [PATCH] try other syntax --- dist/main/index.js | 12 +++++++----- main.ts | 11 +++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dist/main/index.js b/dist/main/index.js index 875a090..8dffb03 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -6962,11 +6962,13 @@ function run() { try { yield _actions_core__WEBPACK_IMPORTED_MODULE_0__.group(`Prepare access to Namespace`, () => __awaiter(this, void 0, void 0, function* () { var commandExists = __nccwpck_require__(1569); - commandExists("nsc") - .then(function () { - _actions_core__WEBPACK_IMPORTED_MODULE_0__.info(`Namespace Cloud CLI found.`); - }) - .catch(installNsc()); + commandExists("nsc", function (err, commandExists) { + if (commandExists) { + _actions_core__WEBPACK_IMPORTED_MODULE_0__.info(`Namespace Cloud CLI found.`); + return; + } + installNsc(); + }); yield _actions_exec__WEBPACK_IMPORTED_MODULE_2__.exec("nsc version"); })); const registry = yield _actions_core__WEBPACK_IMPORTED_MODULE_0__.group(`Log into Namespace workspace`, () => __awaiter(this, void 0, void 0, function* () { diff --git a/main.ts b/main.ts index 7a097ca..4efb330 100644 --- a/main.ts +++ b/main.ts @@ -9,11 +9,14 @@ async function run(): Promise { await core.group(`Prepare access to Namespace`, async () => { var commandExists = require("command-exists"); - commandExists("nsc") - .then(function () { + commandExists("nsc", function (err, commandExists) { + if (commandExists) { core.info(`Namespace Cloud CLI found.`); - }) - .catch(installNsc()); + return; + } + + installNsc(); + }); await exec.exec("nsc version"); });