setup-cpp/dist/cache.32a23f6d.js

3 lines
23 KiB
JavaScript
Raw Normal View History

function e(e,t,r,o){Object.defineProperty(e,t,{get:r,set:o,enumerable:!0,configurable:!0})}function t(e){return e&&e.__esModule?e.default:e}var r=require("child_process"),o=require("util"),s=require("path"),a=require("os"),i=require("fs"),n=require("assert"),c=require("crypto"),l=require("stream"),p=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire810d;p.register("iNHnD",((t,r)=>{async function o(e,t){if(s.isCacheFeatureAvailable()){const r=a.getCacheDistributor(e,t,void 0);await r.restoreCache()}}e(t.exports,"cacheDependencies",(()=>o));var s=p("3Mp5H"),a=p("tIILP")})),p.register("tIILP",((t,r)=>{function o(e,t,r){switch(e){case n.Pip:return new s.default(t,r);case n.Pipenv:return new a.default(t,r);case n.Poetry:return new i.default(t,r);default:throw Error(`Caching for '${e}' is not supported`)}}e(t.exports,"getCacheDistributor",(()=>o));var s=p("5p0V2"),a=p("gyWii"),i=p("9rlmk");let n;(e=>{e.Pip="pip",e.Pipenv="pipenv",e.Poetry="poetry"})(n||(n={}))})),p.register("5p0V2",(function(i,n){e(i.exports,"default",(()=>f));var c=p("b5WCL"),l=p("9bqVn"),u=p("ca0ts"),h=p("c3SoR"),d=p("3Mp5H"),f=class extends h.default{constructor(e,t="**/requirements.txt"){super("pip",t),this.pythonVersion=e}async getCacheGlobalDirectories(){let e=1,i="",n="";if(d.IS_WINDOWS){const e=t(o).promisify(r.exec);({stdout:i,stderr:n}=await e("pip cache dir"))}else({stdout:i,stderr:n,exitCode:e}=await u.getExecOutput("pip cache dir"));if(e&&n)throw Error("Could not get cache folder path for pip package manager");let c=i.trim();return c.includes("~")&&(c=s.join(t(a).homedir(),c.slice(1))),l.debug("global cache directory path is "+c),[c]}async computeKeys(){const e=await c.hashFiles(this.cacheDependencyPath);return{primaryKey:`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}-${e}`,restoreKey:[`${this.CACHE_KEY_PREFIX}-${process.env.RUNNER_OS}-python-${this.pythonVersion}-${this.packageManager}`]}}}})),p.register("b5WCL",(function(e,t){"use strict";function r(e,t){return o(this,void 0,void 0,(function*(){return yield s.DefaultGlobber.create(e,t)}))}var o=e.exports&&e.exports.__awaiter||((e,t,r,o)=>new(r||(r=Promise))(((s,a)=>{function i(e){try{c(o.next(e))}catch(e){a(e)}}function n(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((e=>{e(t)}))).then(i,n)}c((o=o.apply(e,t||[])).next())})));Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.hashFiles=e.exports.create=void 0;var s=p("2LsYP"),a=p("c7nrF");e.exports.create=r,e.exports.hashFiles=function(e,t){return o(this,void 0,void 0,(function*(){let o=!0;t&&"boolean"==typeof t.followSymbolicLinks&&(o=t.followSymbolicLinks);const s=yield r(e,{followSymbolicLinks:o});return a.hashFiles(s)}))}})),p.register("2LsYP",(function(e,t){"use strict";var r=e.exports&&e.exports.__createBinding||(Object.create?(e,t,r,o)=>{void 0===o&&(o=r),Object.defineProperty(e,o,{enumerable:!0,get(){return t[r]}})}:(e,t,r,o)=>{void 0===o&&(o=r),e[o]=t[r]}),o=e.exports&&e.exports.__setModuleDefault||(Object.create?(e,t)=>{Object.defineProperty(e,"default",{enumerable:!0,value:t})}:(e,t)=>{e.default=t}),a=e.exports&&e.exports.__importStar||(e=>{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.hasOwnProperty.call(e,s)&&r(t,e,s);return o(t,e),t}),n=e.exports&&e.exports.__awaiter||((e,t,r,o)=>new(r||(r=Promise))(((s,a)=>{function i(e){try{c(o.next(e))}catch(e){a(e)}}function n(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((e=>{e(t)}))).then(i,n)}c((o=o.apply(e,t||[])).next())}))),c=e.exports&&e.exports.__asyncValues||function(e){function t(t){r[t]=e[t]&&(r=>new Promise(((o,s)=>{((e,t,r,o)=>{Promise.resolve(o).then((t=>{e({value:t,done:r})}),t)})(o,s,(r=e[t](r)).done,r.value)})))}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=e[Symbol.asyncIterator];return o?o.cal
//# sourceMappingURL=cache.32a23f6d.js.map