action-setup/dist/index.js

1 line
245 KiB
JavaScript
Raw Permalink Normal View History

2021-03-23 13:48:54 +08:00
module.exports=(()=>{var __webpack_modules__={2492:e=>{"use strict";e.exports=JSON.parse('{"anyOf":[{"$ref":"#/definitions/RunInstall"},{"type":"array","items":{"$ref":"#/definitions/RunInstall"}},{"type":["null","boolean"]}],"definitions":{"RunInstall":{"type":"object","properties":{"recursive":{"type":"boolean"},"cwd":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}}}},"$schema":"http://json-schema.org/draft-07/schema#"}')},6011:function(e,n,r){"use strict";var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:true});const s=r(6832);const l=f(r(8527));const c=f(r(3406));const i=f(r(9282));const v=f(r(6866));const p=f(r(2726));async function main(){const e=l.default();const n=s.getState("is_post");if(n==="true")return p.default(e);s.saveState("is_post","true");await i.default(e);console.log("Installation Completed!");c.default(e);v.default(e)}main().catch(e=>{console.error(e);s.setFailed(e)})},8527:function(e,n,r){"use strict";var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:true});n.getInputs=void 0;const s=r(6832);const l=f(r(4010));const c=r(986);const i={required:true};const v=e=>l.default(s.getInput(e,i));const p=()=>({version:s.getInput("version",i),dest:v("dest"),runInstall:c.parseRunInstall("run_install")});n.getInputs=p;n.default=n.getInputs},986:function(e,n,r){"use strict";var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:true});n.parseRunInstall=void 0;const s=f(r(1765));const l=r(9520);const c=f(r(8469));const i=r(6832);const v=f(r(2492));const p={required:true};function parseRunInstall(e){const n=l.load(i.getInput(e,p));const r=new c.default({allErrors:true});const f=r.compile(v.default);if(!f(n)){for(const e of f.errors){i.error(`with.run_install${e.dataPath}: ${e.message}`)}return s.default.exit(1)}if(!n)return[];if(n===true)return[{recursive:true}];if(Array.isArray(n))return n;return[n]}n.parseRunInstall=parseRunInstall},9282:function(e,n,r){"use strict";var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:true});n.install=n.runSelfInstaller=void 0;const s=r(6832);const l=f(r(7388));n.runSelfInstaller=l.default;async function install(e){s.startGroup("Running self-installer...");const n=await l.default(e);s.endGroup();if(n){return s.setFailed(`Something does wrong, self-installer exits with code ${n}`)}}n.install=install;n.default=install},7388:function(e,n,r){"use strict";var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:true});n.runSelfInstaller=void 0;const s=r(3129);const l=r(1765);const c=r(5622);const i=r(4240);const v=f(r(2192));async function runSelfInstaller(e){const{version:n,dest:r}=e;const f=n?`pnpm@${n}`:"pnpm";const p=c.join(r,"package.json");await i.remove(r);await i.ensureFile(p);await i.writeFile(p,JSON.stringify({private:true}));const d=s.spawn(l.execPath,["-","install",f,"--no-lockfile"],{cwd:r,stdio:["pipe","inherit","inherit"]});const a=await v.default("https://pnpm.js.org/pnpm.js");a.body.pipe(d.stdin);return new Promise((e,n)=>{d.on("error",n);d.on("close",e)})}n.runSelfInstaller=runSelfInstaller;n.default=runSelfInstaller},3406:(e,n,r)=>{"use strict";Object.defineProperty(n,"__esModule",{value:true});n.setOutputs=void 0;const f=r(6832);const s=r(1630);function setOutputs(e){const n=s.getBinDest(e);f.addPath(n);f.setOutput("dest",e.dest);f.setOutput("bin_dest",n)}n.setOutputs=setOutputs;n.default=setOutputs},6866:(e,n,r)=>{"use strict";Object.defineProperty(n,"__esModule",{value:true});n.runPnpmInstall=void 0;const f=r(3129);const s=r(6832);const l=r(1630);function runPnpmInstall(e){const n=l.patchPnpmEnv(e);for(const r of e.runInstall){const e=["install"];if(r.recursive)e.unshift("recursive");if(r.args)e.push(...r.args);const l=["pnpm",...e].join(" ");s.startGroup(`Running ${l}...`);c