semver and channel for cache dir
This commit is contained in:
@@ -46,7 +46,10 @@ if (!tempDirectory) {
|
||||
}
|
||||
function getFlutter(version, channel) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let toolPath = tc.find('Flutter', version);
|
||||
// make semver compatible, eg: 1.7.8+hotfix.4 -> 1.7.8-hotfix.4
|
||||
const semver = version.replace('+', '-');
|
||||
const cleanver = `${semver}-${channel}`;
|
||||
let toolPath = tc.find('Flutter', cleanver);
|
||||
if (toolPath) {
|
||||
core.debug(`Tool found in cache ${toolPath}`);
|
||||
}
|
||||
@@ -57,7 +60,7 @@ function getFlutter(version, channel) {
|
||||
let tempDir = generateTempDir();
|
||||
const sdkDir = yield extractDownload(sdkFile, tempDir);
|
||||
core.debug(`Flutter sdk extracted to ${sdkDir}`);
|
||||
toolPath = yield tc.cacheDir(sdkDir, 'Flutter', version);
|
||||
toolPath = yield tc.cacheDir(sdkDir, 'Flutter', cleanver);
|
||||
}
|
||||
core.exportVariable('FLUTTER_HOME', toolPath);
|
||||
core.addPath(path.join(toolPath, 'bin'));
|
||||
|
||||
Reference in New Issue
Block a user