From 2f9b156c84fc9df4188fa7d13c76121d8f6dc529 Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Thu, 12 May 2022 07:47:12 +0900 Subject: [PATCH] `npm run all` --- dist/index.js | 26 ++++++++++++-------------- src/audit.ts | 4 ++-- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/dist/index.js b/dist/index.js index a308d16..19cbbd5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -21,17 +21,15 @@ class Audit { } run(auditLevel, productionFlag, jsonFlag) { try { + const auditOptions = ['audit', '--audit-level', auditLevel]; const isWindowsEnvironment = process.platform == "win32"; const cmd = (isWindowsEnvironment) ? 'npm.cmd' : 'npm'; - - const auditOptions = ['audit', '--audit-level', auditLevel]; if (productionFlag === 'true') { auditOptions.push('--production'); } if (jsonFlag === 'true') { auditOptions.push('--json'); } - const result = child_process_1.spawnSync(cmd, auditOptions, { encoding: 'utf-8', maxBuffer: SPAWN_PROCESS_BUFFER_SIZE @@ -833,8 +831,8 @@ class OidcClient { const res = yield httpclient .getJson(id_token_url) .catch(error => { - throw new Error(`Failed to get ID Token. \n - Error Code : ${error.statusCode}\n + throw new Error(`Failed to get ID Token. \n + Error Code : ${error.statusCode}\n Error Message: ${error.result.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; @@ -13116,7 +13114,7 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"] /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; -/******/ +/******/ /******/ // The require function /******/ function __nccwpck_require__(moduleId) { /******/ // Check if module is in cache @@ -13130,7 +13128,7 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"] /******/ // no module.loaded needed /******/ exports: {} /******/ }; -/******/ +/******/ /******/ // Execute the module function /******/ var threw = true; /******/ try { @@ -13139,23 +13137,23 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"] /******/ } finally { /******/ if(threw) delete __webpack_module_cache__[moduleId]; /******/ } -/******/ +/******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } -/******/ +/******/ /************************************************************************/ /******/ /* webpack/runtime/compat */ -/******/ +/******/ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/"; -/******/ +/******/ /************************************************************************/ -/******/ +/******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module is referenced by other modules so it can't be inlined /******/ var __webpack_exports__ = __nccwpck_require__(3109); /******/ module.exports = __webpack_exports__; -/******/ +/******/ /******/ })() -; \ No newline at end of file +; diff --git a/src/audit.ts b/src/audit.ts index d510c19..80008a1 100644 --- a/src/audit.ts +++ b/src/audit.ts @@ -15,8 +15,8 @@ export class Audit { try { const auditOptions: Array = ['audit', '--audit-level', auditLevel] - const isWindowsEnvironment: boolean = process.platform == "win32"; - const cmd: string = (isWindowsEnvironment) ? 'npm.cmd' : 'npm'; + const isWindowsEnvironment: boolean = process.platform == 'win32' + const cmd: string = isWindowsEnvironment ? 'npm.cmd' : 'npm' if (productionFlag === 'true') { auditOptions.push('--production')