remove async from getCacheDistributor
This commit is contained in:
parent
87683fb568
commit
f3bb768479
3 changed files with 11 additions and 22 deletions
29
dist/setup/index.js
vendored
29
dist/setup/index.js
vendored
|
@ -6641,7 +6641,7 @@ function cacheDepencies(pythonVersion) {
|
||||||
throw new Error('Caching is not supported on GHES');
|
throw new Error('Caching is not supported on GHES');
|
||||||
}
|
}
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path') || undefined;
|
const cacheDependencyPath = core.getInput('cache-dependency-path') || undefined;
|
||||||
const cacheDistributor = yield cache_factory_1.getCacheDistributor(cache, pythonVersion, cacheDependencyPath);
|
const cacheDistributor = cache_factory_1.getCacheDistributor(cache, pythonVersion, cacheDependencyPath);
|
||||||
yield cacheDistributor.restoreCache();
|
yield cacheDistributor.restoreCache();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -43871,15 +43871,6 @@ module.exports = require("net");
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
|
@ -43892,16 +43883,14 @@ var PackageManagers;
|
||||||
PackageManagers["Pipenv"] = "pipenv";
|
PackageManagers["Pipenv"] = "pipenv";
|
||||||
})(PackageManagers = exports.PackageManagers || (exports.PackageManagers = {}));
|
})(PackageManagers = exports.PackageManagers || (exports.PackageManagers = {}));
|
||||||
function getCacheDistributor(packageManager, pythonVersion, cacheDependencyPath) {
|
function getCacheDistributor(packageManager, pythonVersion, cacheDependencyPath) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
switch (packageManager) {
|
||||||
switch (packageManager) {
|
case PackageManagers.Pip:
|
||||||
case PackageManagers.Pip:
|
return new pip_cache_1.default(cacheDependencyPath);
|
||||||
return new pip_cache_1.default(cacheDependencyPath);
|
case PackageManagers.Pipenv:
|
||||||
case PackageManagers.Pipenv:
|
return new pipenv_cache_1.default(pythonVersion, cacheDependencyPath);
|
||||||
return new pipenv_cache_1.default(pythonVersion, cacheDependencyPath);
|
default:
|
||||||
default:
|
throw new Error(`Caching for '${packageManager}' is not supported`);
|
||||||
throw new Error(`Caching for '${packageManager}' is not supported`);
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.getCacheDistributor = getCacheDistributor;
|
exports.getCacheDistributor = getCacheDistributor;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ export enum PackageManagers {
|
||||||
Pipenv = 'pipenv'
|
Pipenv = 'pipenv'
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getCacheDistributor(
|
export function getCacheDistributor(
|
||||||
packageManager: string,
|
packageManager: string,
|
||||||
pythonVersion: string,
|
pythonVersion: string,
|
||||||
cacheDependencyPath: string | undefined
|
cacheDependencyPath: string | undefined
|
||||||
|
|
|
@ -18,7 +18,7 @@ async function cacheDepencies(pythonVersion: string) {
|
||||||
}
|
}
|
||||||
const cacheDependencyPath =
|
const cacheDependencyPath =
|
||||||
core.getInput('cache-dependency-path') || undefined;
|
core.getInput('cache-dependency-path') || undefined;
|
||||||
const cacheDistributor = await getCacheDistributor(
|
const cacheDistributor = getCacheDistributor(
|
||||||
cache,
|
cache,
|
||||||
pythonVersion,
|
pythonVersion,
|
||||||
cacheDependencyPath
|
cacheDependencyPath
|
||||||
|
|
Loading…
Add table
Reference in a new issue