Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function run() {
core.warning('This action is moved to azure/containers-actions repository, update your workflows to use those actions instead.');
let pathToDockerConfig = process.env['DOCKER_CONFIG'];
if (pathToDockerConfig && ioUtil.exists(pathToDockerConfig)) {
io.rmRF(pathToDockerConfig); // Deleting the docker config directory
core.debug(`${pathToDockerConfig} has been successfully deleted`);
};
issueCommand('set-env', { name: 'DOCKER_CONFIG' }, '');
console.log('DOCKER_CONFIG environment variable unset');
}
return __awaiter(this, void 0, void 0, function* () {
var defer = Q.defer();
if (packageUtility_1.exist(unzipLocation)) {
yield io.rmRF(unzipLocation);
}
var unzipper = new DecompressZip(zipLocation);
console.log('extracting ' + zipLocation + ' to ' + unzipLocation);
unzipper.on('error', function (error) {
defer.reject(error);
});
unzipper.on('extract', function (log) {
console.log('extracted ' + zipLocation + ' to ' + unzipLocation + ' Successfully');
defer.resolve(unzipLocation);
});
unzipper.extract({
path: unzipLocation
});
return defer.promise;
});
}
return __awaiter(this, void 0, void 0, function* () {
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
core.debug(`destination ${folderPath}`);
const markerPath = `${folderPath}.complete`;
yield io.rmRF(folderPath);
yield io.rmRF(markerPath);
yield io.mkdirP(folderPath);
return folderPath;
});
}
return __awaiter(this, void 0, void 0, function* () {
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
core.debug(`destination ${folderPath}`);
const markerPath = `${folderPath}.complete`;
yield io.rmRF(folderPath);
yield io.rmRF(markerPath);
yield io.mkdirP(folderPath);
return folderPath;
});
}
return __awaiter(this, void 0, void 0, function* () {
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
core.debug(`destination ${folderPath}`);
const markerPath = `${folderPath}.complete`;
yield io.rmRF(folderPath);
yield io.rmRF(markerPath);
yield io.mkdirP(folderPath);
return folderPath;
});
}
async function _createToolPath(
tool: string,
version: string,
arch?: string
): Promise {
const folderPath = path.join(
cacheRoot,
tool,
semver.clean(version) || version,
arch || ''
)
core.debug(`destination ${folderPath}`)
const markerPath = `${folderPath}.complete`
await io.rmRF(folderPath)
await io.rmRF(markerPath)
await io.mkdirP(folderPath)
return folderPath
}
async function _createToolPath(
tool: string,
version: string,
arch?: string
): Promise {
const folderPath = path.join(
cacheRoot,
tool,
semver.clean(version) || version,
arch || ''
)
core.debug(`destination ${folderPath}`)
const markerPath = `${folderPath}.complete`
await io.rmRF(folderPath)
await io.rmRF(markerPath)
await io.mkdirP(folderPath)
return folderPath
}
return __awaiter(this, void 0, void 0, function* () {
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
core.debug(`destination ${folderPath}`);
const markerPath = `${folderPath}.complete`;
yield io.rmRF(folderPath);
yield io.rmRF(markerPath);
yield io.mkdirP(folderPath);
return folderPath;
});
}
return __awaiter(this, void 0, void 0, function* () {
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
core.debug(`destination ${folderPath}`);
const markerPath = `${folderPath}.complete`;
yield io.rmRF(folderPath);
yield io.rmRF(markerPath);
yield io.mkdirP(folderPath);
return folderPath;
});
}