From f6401fba07b139499ad1675dcefd069f4a662555 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Fri, 21 Oct 2022 08:45:51 +0800 Subject: [PATCH] chore: build js --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index f401b33..cccee2b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -4339,7 +4339,7 @@ var external_fs_default = /*#__PURE__*/__webpack_require__.n(external_fs_); // EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js var core = __webpack_require__(397); ;// CONCATENATED MODULE: ./src/index.ts -;_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var pkgPath,data,rename,version,description,resolvePath,jsonStr,jsonObj,newData;return _regeneratorRuntime().wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.prev=0;pkgPath=(0,core.getInput)('path');data=(0,core.getInput)('data');rename=(0,core.getInput)('rename');version=(0,core.getInput)('version');description=(0,core.getInput)('description');resolvePath=external_path_default().resolve(process.cwd(),pkgPath);if(external_fs_default().existsSync(resolvePath)){_context.next=9;break;}throw new Error("File \x1B[31;1m".concat(resolvePath,"\x1B[0m does not exist!"));case 9:_context.next=11;return external_fs_default().promises.readFile(resolvePath);case 11:_context.next=13;return _context.sent.toString();case 13:jsonStr=_context.sent;jsonObj=JSON.parse(jsonStr);if(data){newData=JSON.parse(data);jsonObj=Object.assign(jsonObj,newData);}if(rename){jsonObj=Object.assign(jsonObj,{name:rename});}if(version){jsonObj=Object.assign(jsonObj,{name:version});}if(description){jsonObj=Object.assign(jsonObj,{name:description});}_context.next=21;return external_fs_default().promises.writeFile(resolvePath,JSON.stringify(jsonObj,null,2));case 21:(0,core.startGroup)("\x1B[32;1m package.json\x1B[0m content: ");(0,core.info)("".concat(JSON.stringify(jsonObj,null,2)));(0,core.endGroup)();Object.keys(jsonObj).forEach(function(keyname){var value=jsonObj[keyname];if(typeof value==='string'||typeof value==='boolean'){(0,core.setOutput)(keyname,value);}else if(Array.isArray(value)){(0,core.setOutput)(keyname,value.join(','));}});// setOutput('name', jsonObj.name); +;_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var pkgPath,data,rename,version,description,resolvePath,jsonStr,jsonObj,newData;return _regeneratorRuntime().wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.prev=0;pkgPath=(0,core.getInput)('path');data=(0,core.getInput)('data');rename=(0,core.getInput)('rename');version=(0,core.getInput)('version');description=(0,core.getInput)('description');resolvePath=external_path_default().resolve(process.cwd(),pkgPath);if(external_fs_default().existsSync(resolvePath)){_context.next=9;break;}throw new Error("File \x1B[31;1m".concat(resolvePath,"\x1B[0m does not exist!"));case 9:_context.next=11;return external_fs_default().promises.readFile(resolvePath);case 11:_context.next=13;return _context.sent.toString();case 13:jsonStr=_context.sent;jsonObj=JSON.parse(jsonStr);if(data){newData=JSON.parse(data);jsonObj=Object.assign(jsonObj,newData);}if(rename){jsonObj=Object.assign(jsonObj,{name:rename});}if(version){jsonObj=Object.assign(jsonObj,{version:version});}if(description){jsonObj=Object.assign(jsonObj,{description:description});}_context.next=21;return external_fs_default().promises.writeFile(resolvePath,JSON.stringify(jsonObj,null,2));case 21:(0,core.startGroup)("\x1B[32;1m package.json\x1B[0m content: ");(0,core.info)("".concat(JSON.stringify(jsonObj,null,2)));(0,core.endGroup)();Object.keys(jsonObj).forEach(function(keyname){var value=jsonObj[keyname];if(typeof value==='string'||typeof value==='boolean'){(0,core.setOutput)(keyname,value);}else if(Array.isArray(value)){(0,core.setOutput)(keyname,value.join(','));}});// setOutput('name', jsonObj.name); // setOutput('version', jsonObj.version); // setOutput('description', jsonObj.description); // setOutput('keywords', (jsonObj.keywords || []).join(','));