mirror of
https://github.com/pnpm/action-setup
synced 2026-11-07 04:57:57 +01:00
Support tilde
This commit is contained in:
1 parent
fe1f80eaca
commit
59a67d7671
5 files changed
+40
-50
No files matched your search
Vendored
+1
-1
@@ -1 +1 @@
|
||||
module.exports=function(e,i){"use strict";var t={};function __webpack_require__(i){if(t[i]){return t[i].exports}var n=t[i]={i:i,l:false,exports:{}};e[i].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(803)}return startup()}({0:function(e,i){"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ref="301414cec74a2b6b63c95b42f2ad1790ccb980ed";i.url=`https://raw.githubusercontent.com/pnpm/self-installer/${i.ref}/install.js`;i.default=i.url},1:function(e){"use strict";class CancelError extends Error{constructor(){super("Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}class PCancelable{static fn(e){return function(){const i=[].slice.apply(arguments);return new PCancelable((t,n,a)=>{i.push(a);e.apply(null,i).then(t,n)})}}constructor(e){this._cancelHandlers=[];this._isPending=true;this._isCanceled=false;this._promise=new Promise((i,t)=>{this._reject=t;return e(e=>{this._isPending=false;i(e)},e=>{this._isPending=false;t(e)},e=>{this._cancelHandlers.push(e)})})}then(e,i){return this._promise.then(e,i)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(){if(!this._isPending||this._isCanceled){return}if(this._cancelHandlers.length>0){try{for(const e of this._cancelHandlers){e()}}catch(e){this._reject(e)}}this._isCanceled=true;this._reject(new CancelError)}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);e.exports=PCancelable;e.exports.CancelError=CancelError},2:function(e,i,t){"use strict";const n=t(747);const a=t(622);const r=t(210);const o={mode:511&~process.umask(),fs:n};const s=e=>{if(process.platform==="win32"){const i=/[<>:"|?*]/.test(e.replace(a.parse(e).root,""));if(i){const i=new Error(`Path contains invalid characters: ${e}`);i.code="EINVAL";throw i}}};e.exports=((e,i)=>Promise.resolve().then(()=>{s(e);i=Object.assign({},o,i);const t=r(i.fs.mkdir);const n=r(i.fs.stat);const c=e=>{return t(e,i.mode).then(()=>e).catch(i=>{if(i.code==="ENOENT"){if(i.message.includes("null bytes")||a.dirname(e)===e){throw i}return c(a.dirname(e)).then(()=>c(e))}return n(e).then(i=>i.isDirectory()?e:Promise.reject()).catch(()=>{throw i})})};return c(a.resolve(e))}));e.exports.sync=((e,i)=>{s(e);i=Object.assign({},o,i);const t=e=>{try{i.fs.mkdirSync(e,i.mode)}catch(n){if(n.code==="ENOENT"){if(n.message.includes("null bytes")||a.dirname(e)===e){throw n}t(a.dirname(e));return t(e)}try{if(!i.fs.statSync(e).isDirectory()){throw new Error("The path is not a directory")}}catch(e){throw n}}return e};return t(a.resolve(e))})},3:function(e,i,t){var n=t(669);var a=t(45);var r=t(791);var o=t(286);var s=t(441).Writable;var c=t(441).PassThrough;var p=function(){};var u=function(e){e&=511;return e&&512-e};var l=function(e,i){var t=new d(e,i);t.end();return t};var f=function(e,i){if(i.path)e.name=i.path;if(i.linkpath)e.linkname=i.linkpath;if(i.size)e.size=parseInt(i.size,10);e.pax=i;return e};var d=function(e,i){this._parent=e;this.offset=i;c.call(this)};n.inherits(d,c);d.prototype.destroy=function(e){this._parent.destroy(e)};var m=function(e){if(!(this instanceof m))return new m(e);s.call(this,e);e=e||{};this._offset=0;this._buffer=a();this._missing=0;this._partial=false;this._onparse=p;this._header=null;this._stream=null;this._overflow=null;this._cb=null;this._locked=false;this._destroyed=false;this._pax=null;this._paxGlobal=null;this._gnuLongPath=null;this._gnuLongLinkPath=null;var i=this;var t=i._buffer;var n=function(){i._continue()};var c=function(e){i._locked=false;if(e)return i.destroy(e);if(!i._stream)n()};var h=function(){i._stream=null;var e=u(i._header.size);if(e)i._parse(e,x);else i._parse(512,w);if(!i._locked)n()};var x=function(){i._buffer.consume(u(i._header.size));i._parse(512,w);n()};var v=function(){var e=i._header.size;i._paxGlobal=o.decodePax(t.slice(0,e));t.consume(e);h()};var b=function(){var e=i._header.size;i._pax=o.decodePax(t.slice(0,e));if(i._paxGlobal)i._pax=r(i._paxGlobal,i._pax);t.consume(e);h()};var g=function(){var n=i._header.size;this._gnuLongPath=o.decodeLongPath(t.slice(0,n),e.filenameEncoding);t.consume(n);h()};var y=function(){var n=i._header.size;this._gnuLongLinkPath=o.decodeLongPath(t.slice(0,n),e.filenameEncoding);t.consume(n);h()};var w=function(){var a=i._offset;var r;try{r=i._header=o.decode(t.slice(0,512),e.filenameEncoding)}catch(e){i.emit("error",e)}t.consume(512);if(!r){i._parse(512,w);n();return}if(r.type==="gnu-long-path"){i._parse(r.size,g);n();return}if(r.type==="gnu-long-link-path"){i._parse(r.size,y);n();return}if(r.type==="pax-global-header"){i._parse(r.size,v);n();return}if(r.type==="pax-header"){i._parse(r.size,b);n();return}if(i._gnuLongPath){r.name=i._gnuLongPath;i._gnuLongPath=null}if(i._gnuLongLinkPath){r.linkname=i._gnuLongLinkPath;i._gnuLongLinkPath=null}if(i._pax){i._header=r=f(r,i._pax);i._pax=null}i._locked=true;if(!r.size||r.type==="direcLine truncated
|
||||
module.exports=function(e,i){"use strict";var n={};function __webpack_require__(i){if(n[i]){return n[i].exports}var t=n[i]={i:i,l:false,exports:{}};e[i].call(t.exports,t,t.exports,__webpack_require__);t.l=true;return t.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(803)}return startup()}({0:function(e,i){"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ref="301414cec74a2b6b63c95b42f2ad1790ccb980ed";i.url=`https://raw.githubusercontent.com/pnpm/self-installer/${i.ref}/install.js`;i.default=i.url},1:function(e){"use strict";class CancelError extends Error{constructor(){super("Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}class PCancelable{static fn(e){return function(){const i=[].slice.apply(arguments);return new PCancelable((n,t,a)=>{i.push(a);e.apply(null,i).then(n,t)})}}constructor(e){this._cancelHandlers=[];this._isPending=true;this._isCanceled=false;this._promise=new Promise((i,n)=>{this._reject=n;return e(e=>{this._isPending=false;i(e)},e=>{this._isPending=false;n(e)},e=>{this._cancelHandlers.push(e)})})}then(e,i){return this._promise.then(e,i)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(){if(!this._isPending||this._isCanceled){return}if(this._cancelHandlers.length>0){try{for(const e of this._cancelHandlers){e()}}catch(e){this._reject(e)}}this._isCanceled=true;this._reject(new CancelError)}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);e.exports=PCancelable;e.exports.CancelError=CancelError},2:function(e,i,n){"use strict";const t=n(747);const a=n(622);const r=n(210);const o={mode:511&~process.umask(),fs:t};const s=e=>{if(process.platform==="win32"){const i=/[<>:"|?*]/.test(e.replace(a.parse(e).root,""));if(i){const i=new Error(`Path contains invalid characters: ${e}`);i.code="EINVAL";throw i}}};e.exports=((e,i)=>Promise.resolve().then(()=>{s(e);i=Object.assign({},o,i);const n=r(i.fs.mkdir);const t=r(i.fs.stat);const c=e=>{return n(e,i.mode).then(()=>e).catch(i=>{if(i.code==="ENOENT"){if(i.message.includes("null bytes")||a.dirname(e)===e){throw i}return c(a.dirname(e)).then(()=>c(e))}return t(e).then(i=>i.isDirectory()?e:Promise.reject()).catch(()=>{throw i})})};return c(a.resolve(e))}));e.exports.sync=((e,i)=>{s(e);i=Object.assign({},o,i);const n=e=>{try{i.fs.mkdirSync(e,i.mode)}catch(t){if(t.code==="ENOENT"){if(t.message.includes("null bytes")||a.dirname(e)===e){throw t}n(a.dirname(e));return n(e)}try{if(!i.fs.statSync(e).isDirectory()){throw new Error("The path is not a directory")}}catch(e){throw t}}return e};return n(a.resolve(e))})},3:function(e,i,n){var t=n(669);var a=n(45);var r=n(791);var o=n(286);var s=n(441).Writable;var c=n(441).PassThrough;var p=function(){};var u=function(e){e&=511;return e&&512-e};var l=function(e,i){var n=new d(e,i);n.end();return n};var f=function(e,i){if(i.path)e.name=i.path;if(i.linkpath)e.linkname=i.linkpath;if(i.size)e.size=parseInt(i.size,10);e.pax=i;return e};var d=function(e,i){this._parent=e;this.offset=i;c.call(this)};t.inherits(d,c);d.prototype.destroy=function(e){this._parent.destroy(e)};var m=function(e){if(!(this instanceof m))return new m(e);s.call(this,e);e=e||{};this._offset=0;this._buffer=a();this._missing=0;this._partial=false;this._onparse=p;this._header=null;this._stream=null;this._overflow=null;this._cb=null;this._locked=false;this._destroyed=false;this._pax=null;this._paxGlobal=null;this._gnuLongPath=null;this._gnuLongLinkPath=null;var i=this;var n=i._buffer;var t=function(){i._continue()};var c=function(e){i._locked=false;if(e)return i.destroy(e);if(!i._stream)t()};var h=function(){i._stream=null;var e=u(i._header.size);if(e)i._parse(e,x);else i._parse(512,w);if(!i._locked)t()};var x=function(){i._buffer.consume(u(i._header.size));i._parse(512,w);t()};var v=function(){var e=i._header.size;i._paxGlobal=o.decodePax(n.slice(0,e));n.consume(e);h()};var b=function(){var e=i._header.size;i._pax=o.decodePax(n.slice(0,e));if(i._paxGlobal)i._pax=r(i._paxGlobal,i._pax);n.consume(e);h()};var g=function(){var t=i._header.size;this._gnuLongPath=o.decodeLongPath(n.slice(0,t),e.filenameEncoding);n.consume(t);h()};var y=function(){var t=i._header.size;this._gnuLongLinkPath=o.decodeLongPath(n.slice(0,t),e.filenameEncoding);n.consume(t);h()};var w=function(){var a=i._offset;var r;try{r=i._header=o.decode(n.slice(0,512),e.filenameEncoding)}catch(e){i.emit("error",e)}n.consume(512);if(!r){i._parse(512,w);t();return}if(r.type==="gnu-long-path"){i._parse(r.size,g);t();return}if(r.type==="gnu-long-link-path"){i._parse(r.size,y);t();return}if(r.type==="pax-global-header"){i._parse(r.size,v);t();return}if(r.type==="pax-header"){i._parse(r.size,b);t();return}if(i._gnuLongPath){r.name=i._gnuLongPath;i._gnuLongPath=null}if(i._gnuLongLinkPath){r.linkname=i._gnuLongLinkPath;i._gnuLongLinkPath=null}if(i._pax){i._header=r=f(r,i._pax);i._pax=null}i._locked=true;if(!r.size||r.type==="direcLine truncated
|
||||
+2
-1
@@ -7,9 +7,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"download": "^8.0.0",
|
||||
"expand-tilde": "^2.0.2",
|
||||
"@actions/core": "^1.2.4",
|
||||
"@actions/glob": "^0.1.0",
|
||||
"@types/download": "^6.2.4",
|
||||
"@types/expand-tilde": "^2.0.0",
|
||||
"@types/node": "^13.13.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Generated
+30
-30
@@ -1,9 +1,10 @@
|
||||
dependencies:
|
||||
'@actions/core': 1.2.4
|
||||
'@actions/glob': 0.1.0
|
||||
'@types/download': 6.2.4
|
||||
'@types/expand-tilde': 2.0.0
|
||||
'@types/node': 13.13.5
|
||||
download: 8.0.0
|
||||
expand-tilde: 2.0.2
|
||||
devDependencies:
|
||||
'@zeit/ncc': 0.22.1
|
||||
typescript: 3.8.3
|
||||
@@ -13,13 +14,6 @@ packages:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg==
|
||||
/@actions/glob/0.1.0:
|
||||
dependencies:
|
||||
'@actions/core': 1.2.4
|
||||
minimatch: 3.0.4
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-lx8SzyQ2FE9+UUvjqY1f28QbTJv+w8qP7kHHbfQRhphrlcx0Mdmm1tZdGJzfxv1jxREa/sLW4Oy8CbGQKCJySA==
|
||||
/@sindresorhus/is/0.7.0:
|
||||
dev: false
|
||||
engines:
|
||||
@@ -40,6 +34,10 @@ packages:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-Lo5dy3ai6LNnbL663sgdzqL1eib11u1yKH6w3v3IXEOO4kRfQpMn1qWUTaumcHLACjFp1RcBx9tUXEvJoR3vcA==
|
||||
/@types/expand-tilde/2.0.0:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-17h/6MRHoetV2QVUVnUfrmaFCXNIFJ3uDJmXlklX2xDtlEb1W0OXLgP+qwND2Ibg/PtQfQi0vx19KGuPayjLiw==
|
||||
/@types/got/8.3.5:
|
||||
dependencies:
|
||||
'@types/node': 13.13.5
|
||||
@@ -63,10 +61,6 @@ packages:
|
||||
node: '>=4'
|
||||
resolution:
|
||||
integrity: sha1-+S5yIzBW38aWlHJ0nCZ72wRrHXA=
|
||||
/balanced-match/1.0.0:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
|
||||
/base64-js/0.0.8:
|
||||
dev: false
|
||||
engines:
|
||||
@@ -80,13 +74,6 @@ packages:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==
|
||||
/brace-expansion/1.1.11:
|
||||
dependencies:
|
||||
balanced-match: 1.0.0
|
||||
concat-map: 0.0.1
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||
/buffer-alloc-unsafe/1.1.0:
|
||||
dev: false
|
||||
resolution:
|
||||
@@ -140,10 +127,6 @@ packages:
|
||||
node: '>= 0.6.x'
|
||||
resolution:
|
||||
integrity: sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=
|
||||
/concat-map/0.0.1:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
|
||||
/content-disposition/0.5.3:
|
||||
dependencies:
|
||||
safe-buffer: 5.1.2
|
||||
@@ -262,6 +245,14 @@ packages:
|
||||
node: '>=0.8.0'
|
||||
resolution:
|
||||
integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||
/expand-tilde/2.0.2:
|
||||
dependencies:
|
||||
homedir-polyfill: 1.0.3
|
||||
dev: false
|
||||
engines:
|
||||
node: '>=0.10.0'
|
||||
resolution:
|
||||
integrity: sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=
|
||||
/ext-list/2.2.2:
|
||||
dependencies:
|
||||
mime-db: 1.43.0
|
||||
@@ -407,6 +398,14 @@ packages:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==
|
||||
/homedir-polyfill/1.0.3:
|
||||
dependencies:
|
||||
parse-passwd: 1.0.0
|
||||
dev: false
|
||||
engines:
|
||||
node: '>=0.10.0'
|
||||
resolution:
|
||||
integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==
|
||||
/http-cache-semantics/3.8.1:
|
||||
dev: false
|
||||
resolution:
|
||||
@@ -518,12 +517,6 @@ packages:
|
||||
node: '>=4'
|
||||
resolution:
|
||||
integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==
|
||||
/minimatch/3.0.4:
|
||||
dependencies:
|
||||
brace-expansion: 1.1.11
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
|
||||
/normalize-url/2.0.1:
|
||||
dependencies:
|
||||
prepend-http: 2.0.0
|
||||
@@ -580,6 +573,12 @@ packages:
|
||||
node: '>=4'
|
||||
resolution:
|
||||
integrity: sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==
|
||||
/parse-passwd/1.0.0:
|
||||
dev: false
|
||||
engines:
|
||||
node: '>=0.10.0'
|
||||
resolution:
|
||||
integrity: sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=
|
||||
/pend/1.2.0:
|
||||
dev: false
|
||||
resolution:
|
||||
@@ -818,9 +817,10 @@ packages:
|
||||
integrity: sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=
|
||||
specifiers:
|
||||
'@actions/core': ^1.2.4
|
||||
'@actions/glob': ^0.1.0
|
||||
'@types/download': ^6.2.4
|
||||
'@types/expand-tilde': ^2.0.0
|
||||
'@types/node': ^13.13.5
|
||||
'@zeit/ncc': ^0.22.1
|
||||
download: ^8.0.0
|
||||
expand-tilde: ^2.0.2
|
||||
typescript: ^3.8.3
|
||||
+1
-1
@@ -4,7 +4,7 @@ import setOutputs from './outputs'
|
||||
import install from './install'
|
||||
|
||||
async function main() {
|
||||
const inputs = await getInputs()
|
||||
const inputs = getInputs()
|
||||
await install(inputs).then(() => {
|
||||
console.log('Installation Completed!')
|
||||
setOutputs(inputs)
|
||||
|
||||
+6
-17
@@ -1,6 +1,5 @@
|
||||
import { inspect } from 'util'
|
||||
import { getInput, error, InputOptions } from '@actions/core'
|
||||
import * as glob from '@actions/glob'
|
||||
import { getInput, InputOptions } from '@actions/core'
|
||||
import expandTilde from 'expand-tilde'
|
||||
|
||||
export interface Inputs {
|
||||
readonly version: string
|
||||
@@ -13,22 +12,12 @@ const options: InputOptions = {
|
||||
required: true,
|
||||
}
|
||||
|
||||
async function parsePath(pattern: string, inputName: string) {
|
||||
const builder = await glob.create(pattern)
|
||||
const paths = await builder.glob()
|
||||
if (paths.length !== 1) {
|
||||
error(`Input ${inputName} is expected to match 1 path, but it matches ${paths.length}: ${inspect(paths)}`)
|
||||
throw process.exit(1)
|
||||
}
|
||||
return paths[0]
|
||||
}
|
||||
const parseInputPath = (name: string) => expandTilde(getInput(name, options))
|
||||
|
||||
const parseInputPath = (name: string) => parsePath(getInput(name, options), name)
|
||||
|
||||
export const getInputs = async (): Promise<Inputs> => ({
|
||||
export const getInputs = (): Inputs => ({
|
||||
version: getInput('version', options),
|
||||
dest: await parseInputPath('dest'),
|
||||
binDest: await parseInputPath('bin_dest'),
|
||||
dest: parseInputPath('dest'),
|
||||
binDest: parseInputPath('bin_dest'),
|
||||
registry: getInput('registry', options),
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user