mirror of
https://github.com/actions/setup-python.git
synced 2025-04-21 22:38:43 +00:00
Remove console logs and debug version
This commit is contained in:
parent
f22ce50675
commit
6e46140c9c
3 changed files with 14 additions and 14 deletions
9
dist/setup/index.js
vendored
9
dist/setup/index.js
vendored
|
@ -64433,13 +64433,11 @@ class PipCache extends cache_distributor_1.default {
|
|||
let primaryKey = '';
|
||||
let restoreKey = '';
|
||||
if (utils_1.IS_LINUX) {
|
||||
console.log('here');
|
||||
const osRelease = yield utils_1.getLinuxOSReleaseInfo();
|
||||
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osRelease}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
|
||||
restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osRelease}-python-${this.pythonVersion}-${this.packageManager}`;
|
||||
}
|
||||
else {
|
||||
console.log('here2');
|
||||
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
|
||||
restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}`;
|
||||
}
|
||||
|
@ -65486,19 +65484,18 @@ function isCacheFeatureAvailable() {
|
|||
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
|
||||
function getLinuxOSReleaseInfo() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const versionId = yield exec.getExecOutput('lsb_release', ['-a'], {
|
||||
const { stdout, stderr, exitCode } = yield exec.getExecOutput('lsb_release', ['-a'], {
|
||||
silent: true
|
||||
});
|
||||
let osVersion = '';
|
||||
let osRelease = '';
|
||||
versionId.stdout.split('\n').forEach(elem => {
|
||||
stdout.split('\n').forEach(elem => {
|
||||
if (elem.includes('Distributor'))
|
||||
osVersion = elem.split(':')[1].trim();
|
||||
if (elem.includes('Release'))
|
||||
osRelease = elem.split(':')[1].trim();
|
||||
});
|
||||
core.info(osRelease);
|
||||
core.info(osVersion);
|
||||
core.debug(`OS Release: ${osRelease}, Version: ${osVersion}`);
|
||||
return `${osVersion}-${osRelease}`;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -61,12 +61,10 @@ class PipCache extends CacheDistributor {
|
|||
let restoreKey = '';
|
||||
|
||||
if (IS_LINUX) {
|
||||
console.log('here');
|
||||
const osRelease = await getLinuxOSReleaseInfo();
|
||||
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osRelease}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
|
||||
restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osRelease}-python-${this.pythonVersion}-${this.packageManager}`;
|
||||
} else {
|
||||
console.log('here2');
|
||||
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
|
||||
restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}`;
|
||||
}
|
||||
|
|
17
src/utils.ts
17
src/utils.ts
|
@ -122,18 +122,23 @@ export function isCacheFeatureAvailable(): boolean {
|
|||
}
|
||||
|
||||
export async function getLinuxOSReleaseInfo() {
|
||||
const versionId = await exec.getExecOutput('lsb_release', ['-a'], {
|
||||
silent: true
|
||||
});
|
||||
const {stdout, stderr, exitCode} = await exec.getExecOutput(
|
||||
'lsb_release',
|
||||
['-a'],
|
||||
{
|
||||
silent: true
|
||||
}
|
||||
);
|
||||
|
||||
let osVersion = '';
|
||||
let osRelease = '';
|
||||
|
||||
versionId.stdout.split('\n').forEach(elem => {
|
||||
stdout.split('\n').forEach(elem => {
|
||||
if (elem.includes('Distributor')) osVersion = elem.split(':')[1].trim();
|
||||
if (elem.includes('Release')) osRelease = elem.split(':')[1].trim();
|
||||
});
|
||||
|
||||
core.info(osRelease);
|
||||
core.info(osVersion);
|
||||
core.debug(`OS Release: ${osRelease}, Version: ${osVersion}`);
|
||||
|
||||
return `${osVersion}-${osRelease}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue