Compare commits

..
Author SHA1 Message Date
khai96_ 271a9df5fb Try different ways 2020-05-09 20:57:00 +07:00
khai96_ 3b5e8836ec Update dist/index.js 2020-05-09 20:52:54 +07:00
khai96_ 0fa2b7d3a5 Use console.log 2020-05-09 20:52:27 +07:00
khai96_ c3e0d9f20f Update dist/index.js 2020-05-09 20:50:21 +07:00
khai96_ d2316507fd Inspect isPost 2020-05-09 20:47:42 +07:00
22 changed files with 112 additions and 346 deletions

No files matched your search

-10
View File
@@ -1,10 +0,0 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- dependabot
- github-actions
+2 -57
View File
@@ -3,7 +3,6 @@ name: Test Action
on: on:
- push - push
- pull_request - pull_request
- workflow_dispatch
jobs: jobs:
test_default_inputs: test_default_inputs:
@@ -58,65 +57,11 @@ jobs:
with: with:
version: 4.11.1 version: 4.11.1
dest: ~/test/pnpm dest: ~/test/pnpm
bin_dest: ~/test/pnpm/.bin
registry: http://registry.yarnpkg.com/
- name: 'Test: which' - name: 'Test: which'
run: which pnpm && which pnpx run: which pnpm && which pnpx
- name: 'Test: install' - name: 'Test: install'
run: pnpm install run: pnpm install
test_run_install:
name: 'Test with run_install (${{ matrix.run_install.name }}, ${{ matrix.os }})'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
pnpm:
- 4.11.1
os:
- ubuntu-latest
- macos-latest
- windows-latest
run_install:
- name: 'null'
value: 'null'
- name: 'empty object'
value: '{}'
- name: 'recursive'
value: |
recursive: true
- name: 'global'
value: |
args:
- --global
- --global-dir=./pnpm-global
- npm
- yarn
- pnpm
- name: 'array'
value: |
- {}
- recursive: true
- args:
- --global
- --global-dir=./pnpm-global
- npm
- yarn
- pnpm
steps:
- uses: actions/checkout@v2
- name: Run the action
uses: ./
with:
version: 4.11.1
run_install: ${{ matrix.run_install.value }}
- name: 'Test: which'
run: which pnpm; which pnpx
- name: 'Test: install'
run: pnpm install
-1
View File
@@ -8,4 +8,3 @@ temp
*.temp *.temp
tmp.* tmp.*
temp.* temp.*
.pnpm-store
+15 -76
View File
@@ -12,27 +12,17 @@ Install PNPM package manager.
**Optional** Where to store PNPM files. **Optional** Where to store PNPM files.
### `bin_dest`
**Optional** Where to store executables (`pnpm` and `pnpx` commands).
### `registry`
**Optional** Registry to download PNPM from.
### `run_install` ### `run_install`
**Optional** (_default:_ `null`) If specified, run `pnpm install`. **Optional** If specified, run `pnpm install`.
If `run_install` is either `null` or `false`, pnpm will not install any npm package.
If `run_install` is `true`, pnpm will install dependencies recursively.
If `run_install` is a YAML string representation of either an object or an array, pnpm will execute every install commands.
#### `run_install.recursive`
**Optional** (_type:_ `boolean`, _default:_ `false`) Whether to use `pnpm recursive install`.
#### `run_install.cwd`
**Optional** (_type:_ `string`) Working directory when run `pnpm [recursive] install`.
#### `run_install.args`
**Optional** (_type:_ `string[]`) Additional arguments after `pnpm [recursive] install`, e.g. `[--frozen-lockfile, --strict-peer-dependencies]`.
## Outputs ## Outputs
@@ -42,28 +32,10 @@ Expanded path of inputs#dest.
### `bin_dest` ### `bin_dest`
Location of `pnpm` and `pnpx` command. Expanded path of inputs#bin_dest.
## Usage example ## Usage example
### Just install PNPM
```yaml
on:
- push
- pull_request
jobs:
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v1.2.1
with:
version: 5.17.2
```
### Install PNPM and a few NPM packages
```yaml ```yaml
on: on:
- push - push
@@ -75,47 +47,14 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: pnpm/action-setup@v1.2.1 - uses: pnpm/action-setup@v1.1.0
with: with:
version: 5.17.2 version: 4.11.1
run_install: |
- recursive: true - name: Install dependencies
args: [--frozen-lockfile, --strict-peer-dependencies] run: pnpm install
- args: [--global, gulp, prettier, typescript]
``` ```
### Use cache to reduce installation time
```yaml
on:
- push
- pull_request
jobs:
runs-on: ubuntu-latest
steps:
build:
- uses: actions/checkout@v2
- name: Cache pnpm modules
uses: actions/cache@v2
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
- uses: pnpm/action-setup@v1.2.1
with:
version: 5.17.2
run_install: true
```
**Note:** You don't need to run `pnpm store prune` at the end; post-action has already taken care of that.
## Notes ## Notes
This action does not setup Node.js for you, use [actions/setup-node](https://github.com/actions/setup-node) yourself. This action does not setup Node.js for you, use [actions/setup-node](https://github.com/actions/setup-node) yourself.
+8
View File
@@ -11,6 +11,14 @@ inputs:
description: Where to store PNPM files description: Where to store PNPM files
required: false required: false
default: ~/setup-pnpm default: ~/setup-pnpm
bin_dest:
description: Where to store executables (pnpm and pnpx commands)
required: false
default: ~/setup-pnpm/.bin
registry:
description: Registry to download PNPM from
required: false
default: https://registry.npmjs.com
run_install: run_install:
description: If specified, run `pnpm install` description: If specified, run `pnpm install`
required: false required: false
+1 -1
View File
@@ -1 +1 @@
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}...`);const{error:c,status:i}=f.spawnSync("pnpm",e,{stdio:"inherit",cwd:r.cwd,shell:true,env:n});s.endGroup();if(c){s.setFailed(c);continue}if(i){s.setFailed(`Command ${l} (cwd: ${r.cwd}) exits with status ${i}`);continue}}}n.runPnpmInstall=runPnpmInstall;n.default=runPnpmInstall},2726:(e,n,r)=>{"use strict";Object.defineProperty(n,"__esModule",{value:true});n.pruneStore=void 0;const f=r(3129);const s=r(6832);const l=r(1630);function pruneStore(e){if(e.runInstall.length===0){console.log("Pruning is unnecessary.");return}s.startGroup("Running pnpm store prune...");const{error:n,status:r}=f.spawnSync("pnpm",["store","prune"],{stdio:"inherit",shell:true,env:l.patchPnpmEnv(e)});s.endGroup();if(n){s.warning(n);return}if(r){s.warning(`command pnpm store prune exits with code ${r}`);return}}n.pruneStore=pruneStore;n.default=pruneStore},1630:function(e,n,r){"use strict";var f=this&&this.__importDefault||fuLine truncated module.exports=function(n,e){"use strict";var f={};function __webpack_require__(e){if(f[e]){return f[e].exports}var r=f[e]={i:e,l:false,exports:{}};n[e].call(r.exports,r,r.exports,__webpack_require__);r.l=true;return r.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(803)}return startup()}({0:function(n,e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.ref="301414cec74a2b6b63c95b42f2ad1790ccb980ed";e.url=`https://raw.githubusercontent.com/pnpm/self-installer/${e.ref}/install.js`;e.default=e.url},17:function(n){"use strict";n.exports=function generate__limitItems(n,e,f){var r=" ";var l=n.level;var s=n.dataLevel;var v=n.schema[e];var c=n.schemaPath+n.util.getProperty(e);var p=n.errSchemaPath+"/"+e;var g=!n.opts.allErrors;var b;var w="data"+(s||"");var i=n.opts.$data&&v&&v.$data,d;if(i){r+=" var schema"+l+" = "+n.util.getData(v.$data,s,n.dataPathArr)+"; ";d="schema"+l}else{d=v}var A=e=="maxItems"?">":"<";r+="if ( ";if(i){r+=" ("+d+" !== undefined && typeof "+d+" != 'number') || "}r+=" "+w+".length "+A+" "+d+") { ";var b=e;var j=j||[];j.push(r);r="";if(n.createErrors!==false){r+=" { keyword: '"+(b||"_limitItems")+"' , dataPath: (dataPath || '') + "+n.errorPath+" , schemaPath: "+n.util.toQuotedString(p)+" , params: { limit: "+d+" } ";if(n.opts.messages!==false){r+=" , message: 'should NOT have ";if(e=="maxItems"){r+="more"}else{r+="fewer"}r+=" than ";if(i){r+="' + "+d+" + '"}else{r+=""+v}r+=" items' "}if(n.opts.verbose){r+=" , schema: ";if(i){r+="validate.schema"+c}else{r+=""+v}r+=" , parentSchema: validate.schema"+n.schemaPath+" , data: "+w+" "}r+=" } "}else{r+=" {} "}var E=r;r=j.pop();if(!n.compositeRule&&g){if(n.async){r+=" throw new ValidationError(["+E+"]); "}else{r+=" validate.errors = ["+E+"]; return false; "}}else{r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+="} ";if(g){r+=" else { "}return r}},34:function(n){n.exports=require("https")},87:function(n){n.exports=require("os")},89:function(n,e,f){"use strict";var r=this&&this.__awaiter||function(n,e,f,r){function adopt(n){return n instanceof f?n:new f(function(e){e(n)})}return new(f||(f=Promise))(function(f,l){function fulfilled(n){try{step(r.next(n))}catch(n){l(n)}}function rejected(n){try{step(r["throw"](n))}catch(n){l(n)}}function step(n){n.done?f(n.value):adopt(n.value).then(fulfilled,rejected)}step((r=r.apply(n,e||[])).next())})};var l=this&&this.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var f in n)if(Object.hasOwnProperty.call(n,f))e[f]=n[f];e["default"]=n;return e};Object.defineProperty(e,"__esModule",{value:true});const s=f(486);const v=l(f(87));const c=l(f(622));var p;(function(n){n[n["Success"]=0]="Success";n[n["Failure"]=1]="Failure"})(p=e.ExitCode||(e.ExitCode={}));function exportVariable(n,e){const f=s.toCommandValue(e);process.env[n]=f;s.issueCommand("set-env",{name:n},f)}e.exportVariable=exportVariable;function setSecret(n){s.issueCommand("add-mask",{},n)}e.setSecret=setSecret;function addPath(n){s.issueCommand("add-path",{},n);process.env["PATH"]=`${n}${c.delimiter}${process.env["PATH"]}`}e.addPath=addPath;function getInput(n,e){const f=process.env[`INPUT_${n.replace(/ /g,"_").toUpperCase()}`]||"";if(e&&e.required&&!f){throw new Error(`Input required and not supplied: ${n}`)}return f.trim()}e.getInput=getInput;function setOutput(n,e){s.issueCommand("set-output",{name:n},e)}e.setOutput=setOutput;function setCommandEcho(n){s.issue("echo",n?"on":"off")}e.setCommandEcho=setCommandEcho;function setFailed(n){process.exitCode=p.Failure;error(n)}e.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}e.isDebug=isDebug;function debug(n){s.issueCommand("debug",{},n)}e.debug=debug;function error(n){s.issue("error",n instanceof Error?n.toString():n)}e.error=error;function warning(n){s.issue("warning",n instanceof Error?n.toString():n)}e.warning=warning;function info(n){process.stdout.write(n+v.EOL)}e.info=info;function startGroup(n){s.issue("group",n)}e.startGroup=startGroup;function endGroup(){s.issue("endgroup")}e.endGroup=endGroup;function group(n,e){return r(this,void 0,void 0,function*(){startGroup(n);let f;try{f=yield e()}finally{endGroup()}return f})}e.group=group;function saveState(n,e){s.issueCommand("save-state",{name:n},e)}e.saveState=saveState;function getState(n){return process.env[`STATE_${n}`]||""}e.getState=getState},90:function(n,e,f){"use strict";var r=f(205);function resolveJavascriptRegExp(n){if(n===null)return false;if(n.length===0)return false;var e=n,f=/\/([gim]*)$/.exec(n),r="";if(e[0]==="/"){if(f)r=f[1];if(r.length>3)return false;if(e[e.length-r.length-1]!=="/")return false}return true}function constructJavascriptRegExp(n){var e=n,f=/\/([gim]*)$/.exec(n),r="";if(e[0]==="/"){if(f)r=f[1];e=e.slice(1,e.length-r.length-1)}return new RegExp(e,r)}function representJavascriptRegExp(n){var e="/"+n.source+"/";if(n.global)e+="g";if(n.multiline)e+="m";ifLine truncated
+9 -11
View File
@@ -7,21 +7,19 @@
"start": "pnpm run build && sh ./run.sh" "start": "pnpm run build && sh ./run.sh"
}, },
"dependencies": { "dependencies": {
"node-fetch": "^2.6.1", "node-fetch": "^2.6.0",
"expand-tilde": "^2.0.2", "expand-tilde": "^2.0.2",
"js-yaml": "^4.0.0", "js-yaml": "^3.13.1",
"ajv": "^6.12.5", "ajv": "^6.12.0",
"fs-extra": "^9.1.0", "@actions/core": "^1.2.4",
"@actions/core": "^1.2.6",
"@types/expand-tilde": "^2.0.0", "@types/expand-tilde": "^2.0.0",
"@types/node-fetch": "^2.5.8", "@types/node-fetch": "^2.5.7",
"@types/js-yaml": "^4.0.0", "@types/js-yaml": "^3.12.3",
"@types/fs-extra": "^9.0.8", "@types/node": "^13.13.5"
"@types/node": "^14.14.35"
}, },
"devDependencies": { "devDependencies": {
"typescript": "^4.2.3", "typescript": "^3.8.3",
"@ts-schema-autogen/cli": "^0.1.2", "@ts-schema-autogen/cli": "^0.1.2",
"@vercel/ncc": "^0.27.0" "@zeit/ncc": "^0.22.1"
} }
} }
+29 -111
View File
@@ -1,25 +1,23 @@
dependencies: dependencies:
'@actions/core': 1.2.6 '@actions/core': 1.2.4
'@types/expand-tilde': 2.0.0 '@types/expand-tilde': 2.0.0
'@types/fs-extra': 9.0.8 '@types/js-yaml': 3.12.3
'@types/js-yaml': 4.0.0 '@types/node': 13.13.5
'@types/node': 14.14.35 '@types/node-fetch': 2.5.7
'@types/node-fetch': 2.5.8 ajv: 6.12.0
ajv: 6.12.6
expand-tilde: 2.0.2 expand-tilde: 2.0.2
fs-extra: 9.1.0 js-yaml: 3.13.1
js-yaml: 4.0.0 node-fetch: 2.6.0
node-fetch: 2.6.1
devDependencies: devDependencies:
'@ts-schema-autogen/cli': 0.1.2 '@ts-schema-autogen/cli': 0.1.2
'@vercel/ncc': 0.27.0 '@zeit/ncc': 0.22.1
typescript: 4.2.3 typescript: 3.8.3
lockfileVersion: 5.2 lockfileVersion: 5.1
packages: packages:
/@actions/core/1.2.6: /@actions/core/1.2.4:
dev: false dev: false
resolution: resolution:
integrity: sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA== integrity: sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg==
/@ts-schema-autogen/cli/0.1.2: /@ts-schema-autogen/cli/0.1.2:
dependencies: dependencies:
'@ts-schema-autogen/main': 0.1.1 '@ts-schema-autogen/main': 0.1.1
@@ -177,39 +175,23 @@ packages:
dev: true dev: true
resolution: resolution:
integrity: sha512-UoOfVEzAUpeSPmjm7h1uk5MH6KZma2z2O7a75onTGjnNvAvMVrPzPL/vBbT65iIGHWj6rokwfmYcmxmlSf2uwg== integrity: sha512-UoOfVEzAUpeSPmjm7h1uk5MH6KZma2z2O7a75onTGjnNvAvMVrPzPL/vBbT65iIGHWj6rokwfmYcmxmlSf2uwg==
/@types/fs-extra/9.0.8:
dependencies:
'@types/node': 14.14.35
dev: false
resolution:
integrity: sha512-bnlTVTwq03Na7DpWxFJ1dvnORob+Otb8xHyUqUWhqvz/Ksg8+JXPlR52oeMSZ37YEOa5PyccbgUNutiQdi13TA==
/@types/js-yaml/3.12.3: /@types/js-yaml/3.12.3:
dev: true
resolution: resolution:
integrity: sha512-otRe77JNNWzoVGLKw8TCspKswRoQToys4tuL6XYVBFxjgeM0RUrx7m3jkaTdxILxeGry3zM8mGYkGXMeQ02guA== integrity: sha512-otRe77JNNWzoVGLKw8TCspKswRoQToys4tuL6XYVBFxjgeM0RUrx7m3jkaTdxILxeGry3zM8mGYkGXMeQ02guA==
/@types/js-yaml/4.0.0:
dev: false
resolution:
integrity: sha512-4vlpCM5KPCL5CfGmTbpjwVKbISRYhduEJvvUWsH5EB7QInhEj94XPZ3ts/9FPiLZFqYO0xoW4ZL8z2AabTGgJA==
/@types/json-schema/7.0.4: /@types/json-schema/7.0.4:
dev: true dev: true
resolution: resolution:
integrity: sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA== integrity: sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==
/@types/node-fetch/2.5.8: /@types/node-fetch/2.5.7:
dependencies: dependencies:
'@types/node': 14.14.35 '@types/node': 13.13.5
form-data: 3.0.0 form-data: 3.0.0
dev: false dev: false
resolution: resolution:
integrity: sha512-fbjI6ja0N5ZA8TV53RUqzsKNkl9fv8Oj3T7zxW7FGv1GSH7gwJaNF8dzCjrqKaxKeUpTz4yT1DaJFq/omNpGfw== integrity: sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw==
/@types/node/13.13.5: /@types/node/13.13.5:
dev: true
resolution: resolution:
integrity: sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g== integrity: sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g==
/@types/node/14.14.35:
dev: false
resolution:
integrity: sha512-Lt+wj8NVPx0zUmUwumiVXapmaLUcAk3yPuHCFVXras9k5VT9TdhJqKqGVUQCD60OTMCl0qxJ57OiTL0Mic3Iag==
/@types/yargs-parser/15.0.0: /@types/yargs-parser/15.0.0:
dev: true dev: true
resolution: resolution:
@@ -220,29 +202,19 @@ packages:
dev: true dev: true
resolution: resolution:
integrity: sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg== integrity: sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg==
/@vercel/ncc/0.27.0: /@zeit/ncc/0.22.1:
dev: true dev: true
hasBin: true hasBin: true
resolution: resolution:
integrity: sha512-DllIJQapnU2YwewIhh/4dYesmMQw3h2cFtabECc/zSJHqUbNa0eJuEkRa6DXbZvh1YPWBtYQoPV17NlDpBw1Vw== integrity: sha512-Qq3bMuonkcnV/96jhy9SQYdh39NXHxNMJ1O31ZFzWG9n52fR2DLtgrNzhj/ahlEjnBziMLGVWDbaS9sf03/fEw==
/ajv/6.12.0: /ajv/6.12.0:
dependencies: dependencies:
fast-deep-equal: 3.1.1 fast-deep-equal: 3.1.1
fast-json-stable-stringify: 2.1.0 fast-json-stable-stringify: 2.1.0
json-schema-traverse: 0.4.1 json-schema-traverse: 0.4.1
uri-js: 4.2.2 uri-js: 4.2.2
dev: true
resolution: resolution:
integrity: sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== integrity: sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==
/ajv/6.12.6:
dependencies:
fast-deep-equal: 3.1.1
fast-json-stable-stringify: 2.1.0
json-schema-traverse: 0.4.1
uri-js: 4.2.2
dev: false
resolution:
integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
/ansi-regex/4.1.0: /ansi-regex/4.1.0:
dev: true dev: true
engines: engines:
@@ -275,23 +247,12 @@ packages:
/argparse/1.0.10: /argparse/1.0.10:
dependencies: dependencies:
sprintf-js: 1.0.3 sprintf-js: 1.0.3
dev: true
resolution: resolution:
integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
/argparse/2.0.1:
dev: false
resolution:
integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
/asynckit/0.4.0: /asynckit/0.4.0:
dev: false dev: false
resolution: resolution:
integrity: sha1-x57Zf380y48robyXkLzDZkdLS3k= integrity: sha1-x57Zf380y48robyXkLzDZkdLS3k=
/at-least-node/1.0.0:
dev: false
engines:
node: '>= 4.0.0'
resolution:
integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==
/balanced-match/1.0.0: /balanced-match/1.0.0:
dev: true dev: true
resolution: resolution:
@@ -387,7 +348,6 @@ packages:
resolution: resolution:
integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
/esprima/4.0.1: /esprima/4.0.1:
dev: true
engines: engines:
node: '>=4' node: '>=4'
hasBin: true hasBin: true
@@ -458,17 +418,6 @@ packages:
node: '>=6 <7 || >=8' node: '>=6 <7 || >=8'
resolution: resolution:
integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
/fs-extra/9.1.0:
dependencies:
at-least-node: 1.0.0
graceful-fs: 4.2.3
jsonfile: 6.1.0
universalify: 2.0.0
dev: false
engines:
node: '>=10'
resolution:
integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
/fs.realpath/1.0.0: /fs.realpath/1.0.0:
dev: true dev: true
resolution: resolution:
@@ -491,6 +440,7 @@ packages:
resolution: resolution:
integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
/graceful-fs/4.2.3: /graceful-fs/4.2.3:
dev: true
resolution: resolution:
integrity: sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== integrity: sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==
/homedir-polyfill/1.0.3: /homedir-polyfill/1.0.3:
@@ -528,17 +478,9 @@ packages:
dependencies: dependencies:
argparse: 1.0.10 argparse: 1.0.10
esprima: 4.0.1 esprima: 4.0.1
dev: true
hasBin: true hasBin: true
resolution: resolution:
integrity: sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== integrity: sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==
/js-yaml/4.0.0:
dependencies:
argparse: 2.0.1
dev: false
hasBin: true
resolution:
integrity: sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==
/json-schema-traverse/0.4.1: /json-schema-traverse/0.4.1:
resolution: resolution:
integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
@@ -554,14 +496,6 @@ packages:
graceful-fs: 4.2.3 graceful-fs: 4.2.3
resolution: resolution:
integrity: sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= integrity: sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
/jsonfile/6.1.0:
dependencies:
universalify: 2.0.0
dev: false
optionalDependencies:
graceful-fs: 4.2.3
resolution:
integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==
/jsonify/0.0.0: /jsonify/0.0.0:
dev: true dev: true
resolution: resolution:
@@ -603,12 +537,12 @@ packages:
dev: true dev: true
resolution: resolution:
integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
/node-fetch/2.6.1: /node-fetch/2.6.0:
dev: false dev: false
engines: engines:
node: 4.x || >=6.0.0 node: 4.x || >=6.0.0
resolution: resolution:
integrity: sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== integrity: sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==
/once/1.4.0: /once/1.4.0:
dependencies: dependencies:
wrappy: 1.0.2 wrappy: 1.0.2
@@ -689,7 +623,6 @@ packages:
resolution: resolution:
integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc= integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc=
/sprintf-js/1.0.3: /sprintf-js/1.0.3:
dev: true
resolution: resolution:
integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
/string-width/3.1.0: /string-width/3.1.0:
@@ -750,25 +683,12 @@ packages:
hasBin: true hasBin: true
resolution: resolution:
integrity: sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== integrity: sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==
/typescript/4.2.3:
dev: true
engines:
node: '>=4.2.0'
hasBin: true
resolution:
integrity: sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==
/universalify/0.1.2: /universalify/0.1.2:
dev: true dev: true
engines: engines:
node: '>= 4.0.0' node: '>= 4.0.0'
resolution: resolution:
integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
/universalify/2.0.0:
dev: false
engines:
node: '>= 10.0.0'
resolution:
integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==
/uri-js/4.2.2: /uri-js/4.2.2:
dependencies: dependencies:
punycode: 2.1.1 punycode: 2.1.1
@@ -863,17 +783,15 @@ packages:
resolution: resolution:
integrity: sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA== integrity: sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==
specifiers: specifiers:
'@actions/core': ^1.2.6 '@actions/core': ^1.2.4
'@ts-schema-autogen/cli': ^0.1.2 '@ts-schema-autogen/cli': ^0.1.2
'@types/expand-tilde': ^2.0.0 '@types/expand-tilde': ^2.0.0
'@types/fs-extra': ^9.0.8 '@types/js-yaml': ^3.12.3
'@types/js-yaml': ^4.0.0 '@types/node': ^13.13.5
'@types/node': ^14.14.35 '@types/node-fetch': ^2.5.7
'@types/node-fetch': ^2.5.8 '@zeit/ncc': ^0.22.1
'@vercel/ncc': ^0.27.0 ajv: ^6.12.0
ajv: ^6.12.5
expand-tilde: ^2.0.2 expand-tilde: ^2.0.2
fs-extra: ^9.1.0 js-yaml: ^3.13.1
js-yaml: ^4.0.0 node-fetch: ^2.6.0
node-fetch: ^2.6.1 typescript: ^3.8.3
typescript: ^4.2.3
-4
View File
@@ -1,10 +1,6 @@
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"pinVersions": false, "pinVersions": false,
"extends": [ "extends": [
"config:base" "config:base"
],
"ignoreDeps": [
"ajv"
] ]
} }
+2
View File
@@ -3,5 +3,7 @@
export HOME="$(pwd)" export HOME="$(pwd)"
export INPUT_VERSION=4.11.1 export INPUT_VERSION=4.11.1
export INPUT_DEST='~/pnpm.temp' export INPUT_DEST='~/pnpm.temp'
export INPUT_BIN_DEST='~/pnpm.temp/.bin'
export INPUT_REGISTRY=https://registry.npmjs.com
export INPUT_RUN_INSTALL=null export INPUT_RUN_INSTALL=null
exec node dist/index.js exec node dist/index.js
+10 -5
View File
@@ -1,15 +1,20 @@
import { setFailed, saveState, getState } from '@actions/core' import { setFailed, getState } from '@actions/core'
import getInputs from './inputs' import getInputs from './inputs'
import setOutputs from './outputs' import setOutputs from './outputs'
import installPnpm from './install-pnpm' import installPnpm from './install-pnpm'
import pnpmInstall from './pnpm-install' import pnpmInstall from './pnpm-install'
import pruneStore from './pnpm-store-prune'
async function main() { async function main() {
const isPost = getState('isPost')
console.log({
is_post: getState('is_post'),
isPost: getState('isPost'),
STATE_isPost: process.env['STATE_isPost'],
})
if (isPost) {
return
}
const inputs = getInputs() const inputs = getInputs()
const isPost = getState('is_post')
if (isPost === 'true') return pruneStore(inputs)
saveState('is_post', 'true')
await installPnpm(inputs) await installPnpm(inputs)
console.log('Installation Completed!') console.log('Installation Completed!')
setOutputs(inputs) setOutputs(inputs)
+4
View File
@@ -5,6 +5,8 @@ import { RunInstall, parseRunInstall } from './run-install'
export interface Inputs { export interface Inputs {
readonly version: string readonly version: string
readonly dest: string readonly dest: string
readonly binDest: string
readonly registry: string
readonly runInstall: RunInstall[] readonly runInstall: RunInstall[]
} }
@@ -17,6 +19,8 @@ const parseInputPath = (name: string) => expandTilde(getInput(name, options))
export const getInputs = (): Inputs => ({ export const getInputs = (): Inputs => ({
version: getInput('version', options), version: getInput('version', options),
dest: parseInputPath('dest'), dest: parseInputPath('dest'),
binDest: parseInputPath('bin_dest'),
registry: getInput('registry', options),
runInstall: parseRunInstall('run_install'), runInstall: parseRunInstall('run_install'),
}) })
+3 -2
View File
@@ -1,5 +1,5 @@
import process from 'process' import process from 'process'
import { load } from 'js-yaml' import { safeLoad } from 'js-yaml'
import Ajv from 'ajv' import Ajv from 'ajv'
import { getInput, error, InputOptions } from '@actions/core' import { getInput, error, InputOptions } from '@actions/core'
import runInstallSchema from './run-install-input.schema.json' import runInstallSchema from './run-install-input.schema.json'
@@ -21,9 +21,10 @@ const options: InputOptions = {
} }
export function parseRunInstall(name: string): RunInstall[] { export function parseRunInstall(name: string): RunInstall[] {
const result: RunInstallInput = load(getInput(name, options)) as any const result: RunInstallInput = safeLoad(getInput(name, options))
const ajv = new Ajv({ const ajv = new Ajv({
allErrors: true, allErrors: true,
async: false,
}) })
const validate = ajv.compile(runInstallSchema) const validate = ajv.compile(runInstallSchema)
if (!validate(result)) { if (!validate(result)) {
+1 -3
View File
@@ -1,13 +1,11 @@
import { setFailed, startGroup, endGroup } from '@actions/core' import { setFailed } from '@actions/core'
import { Inputs } from '../inputs' import { Inputs } from '../inputs'
import runSelfInstaller from './run' import runSelfInstaller from './run'
export { runSelfInstaller } export { runSelfInstaller }
export async function install(inputs: Inputs) { export async function install(inputs: Inputs) {
startGroup('Running self-installer...')
const status = await runSelfInstaller(inputs) const status = await runSelfInstaller(inputs)
endGroup()
if (status) { if (status) {
return setFailed(`Something does wrong, self-installer exits with code ${status}`) return setFailed(`Something does wrong, self-installer exits with code ${status}`)
} }
+9 -14
View File
@@ -1,25 +1,20 @@
import { spawn } from 'child_process' import { spawn } from 'child_process'
import { execPath } from 'process' import { execPath } from 'process'
import { join } from 'path' import { downloadSelfInstaller } from '../self-installer'
import { remove, ensureFile, writeFile } from 'fs-extra'
import fetch from 'node-fetch'
import { Inputs } from '../inputs' import { Inputs } from '../inputs'
export async function runSelfInstaller(inputs: Inputs): Promise<number> { export async function runSelfInstaller(inputs: Inputs): Promise<number> {
const { version, dest } = inputs const cp = spawn(execPath, {
const target = version ? `pnpm@${version}` : 'pnpm' env: {
const pkgJson = join(dest, 'package.json') PNPM_VERSION: inputs.version,
PNPM_DEST: inputs.dest,
await remove(dest) PNPM_BIN_DEST: inputs.binDest,
await ensureFile(pkgJson) PNPM_REGISTRY: inputs.registry,
await writeFile(pkgJson, JSON.stringify({ private: true })) },
const cp = spawn(execPath, ['-', 'install', target, '--no-lockfile'], {
cwd: dest,
stdio: ['pipe', 'inherit', 'inherit'], stdio: ['pipe', 'inherit', 'inherit'],
}) })
const response = await fetch('https://pnpm.js.org/pnpm.js') const response = await downloadSelfInstaller()
response.body.pipe(cp.stdin) response.body.pipe(cp.stdin)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
+2 -4
View File
@@ -1,12 +1,10 @@
import { setOutput, addPath } from '@actions/core' import { setOutput, addPath } from '@actions/core'
import { Inputs } from '../inputs' import { Inputs } from '../inputs'
import { getBinDest } from '../utils'
export function setOutputs(inputs: Inputs) { export function setOutputs(inputs: Inputs) {
const binDest = getBinDest(inputs) addPath(inputs.binDest)
addPath(binDest)
setOutput('dest', inputs.dest) setOutput('dest', inputs.dest)
setOutput('bin_dest', binDest) setOutput('bin_dest', inputs.binDest)
} }
export default setOutputs export default setOutputs
+8 -6
View File
@@ -1,10 +1,14 @@
import process from 'process'
import path from 'path'
import { spawnSync } from 'child_process' import { spawnSync } from 'child_process'
import { setFailed, startGroup, endGroup } from '@actions/core' import { setFailed } from '@actions/core'
import { Inputs } from '../inputs' import { Inputs } from '../inputs'
import { patchPnpmEnv } from '../utils'
export function runPnpmInstall(inputs: Inputs) { export function runPnpmInstall(inputs: Inputs) {
const env = patchPnpmEnv(inputs) const env = {
...process.env,
PATH: inputs.binDest + path.delimiter + process.env.PATH
}
for (const options of inputs.runInstall) { for (const options of inputs.runInstall) {
const args = ['install'] const args = ['install']
@@ -12,7 +16,7 @@ export function runPnpmInstall(inputs: Inputs) {
if (options.args) args.push(...options.args) if (options.args) args.push(...options.args)
const cmdStr = ['pnpm', ...args].join(' ') const cmdStr = ['pnpm', ...args].join(' ')
startGroup(`Running ${cmdStr}...`) console.log('Running', cmdStr)
const { error, status } = spawnSync('pnpm', args, { const { error, status } = spawnSync('pnpm', args, {
stdio: 'inherit', stdio: 'inherit',
@@ -21,8 +25,6 @@ export function runPnpmInstall(inputs: Inputs) {
env, env,
}) })
endGroup()
if (error) { if (error) {
setFailed(error) setFailed(error)
continue continue
-31
View File
@@ -1,31 +0,0 @@
import { spawnSync } from 'child_process'
import { warning, startGroup, endGroup } from '@actions/core'
import { Inputs } from '../inputs'
import { patchPnpmEnv } from '../utils'
export function pruneStore(inputs: Inputs) {
if (inputs.runInstall.length === 0) {
console.log('Pruning is unnecessary.')
return
}
startGroup('Running pnpm store prune...')
const { error, status } = spawnSync('pnpm', ['store', 'prune'], {
stdio: 'inherit',
shell: true,
env: patchPnpmEnv(inputs)
})
endGroup()
if (error) {
warning(error)
return
}
if (status) {
warning(`command pnpm store prune exits with code ${status}`)
return
}
}
export default pruneStore
+4
View File
@@ -0,0 +1,4 @@
import fetch from 'node-fetch'
import url from './url'
export const downloadSelfInstaller = () => fetch(url)
export default downloadSelfInstaller
+2
View File
@@ -0,0 +1,2 @@
export * from './url'
export * from './download'
+3
View File
@@ -0,0 +1,3 @@
export const ref = '301414cec74a2b6b63c95b42f2ad1790ccb980ed'
export const url = `https://raw.githubusercontent.com/pnpm/self-installer/${ref}/install.js`
export default url
-10
View File
@@ -1,10 +0,0 @@
import process from 'process'
import path from 'path'
import { Inputs } from '../inputs'
export const getBinDest = (inputs: Inputs): string => path.join(inputs.dest, 'node_modules', '.bin')
export const patchPnpmEnv = (inputs: Inputs): NodeJS.ProcessEnv => ({
...process.env,
PATH: getBinDest(inputs) + path.delimiter + process.env.PATH
})