From 8a9ce2ac2b1f8eb7fd188d64f302fed519d03c67 Mon Sep 17 00:00:00 2001 From: moweilin Date: Wed, 17 Jan 2024 23:55:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9mkdir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/index.js | 5 ++--- package.json | 2 +- src/index.js | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/dist/index.js b/dist/index.js index d0e4e4d..1d5c774 100644 --- a/dist/index.js +++ b/dist/index.js @@ -26587,20 +26587,19 @@ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { const core = __nccwpck_require__(2186); -const { mkdir, writeFileSync, existsSync } = __nccwpck_require__(7147); +const { writeFileSync, existsSync, mkdirSync } = __nccwpck_require__(7147); const os = __nccwpck_require__(2037); const path = __nccwpck_require__(1017); try { // `who-to-greet` input defined in action metadata file const kubeconfig = core.getInput('kubeconfig'); - core.info(`input:\n${kubeconfig}\n************\n`) if(!kubeconfig){ throw { message: "kubeconfig should not be empty" } } const parentDir = path.join(os.homedir(),".kube") - mkdir(parentDir,{recursive:true}) + mkdirSync(parentDir,{recursive:true}) const configFile = path.join(parentDir,"config") if(existsSync(configFile) && !core.getBooleanInput("force")){ throw { diff --git a/package.json b/package.json index d69ad15..d808001 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "action-kubernetes-login", - "version": "0.0.4", + "version": "0.0.5", "type": "commonjs", "scripts": { "build": "ncc build src/index.js -o dist" diff --git a/src/index.js b/src/index.js index bad144c..2439eb3 100644 --- a/src/index.js +++ b/src/index.js @@ -1,18 +1,17 @@ const core = require('@actions/core'); -const { mkdir, writeFileSync, existsSync } = require('fs'); +const { writeFileSync, existsSync, mkdirSync } = require('fs'); const os = require('os'); const path = require('path'); try { // `who-to-greet` input defined in action metadata file const kubeconfig = core.getInput('kubeconfig'); - core.info(`input:\n${kubeconfig}\n************\n`) if(!kubeconfig){ throw { message: "kubeconfig should not be empty" } } const parentDir = path.join(os.homedir(),".kube") - mkdir(parentDir,{recursive:true}) + mkdirSync(parentDir,{recursive:true}) const configFile = path.join(parentDir,"config") if(existsSync(configFile) && !core.getBooleanInput("force")){ throw {