From a1e481922dbaaa8edd9b5e75b643d7a39968a4e0 Mon Sep 17 00:00:00 2001 From: Alif Rachmawadi Date: Sun, 18 Aug 2019 21:23:37 +0700 Subject: [PATCH] handle 1.7 as 1.7.x --- lib/installer.js | 4 ++++ src/installer.ts | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/lib/installer.js b/lib/installer.js index 0063225..da54488 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -49,6 +49,10 @@ if (!tempDirectory) { } function getFlutter(version, channel) { return __awaiter(this, void 0, void 0, function* () { + const versionPart = version.split('.'); + if (versionPart[1] == null || versionPart[2] == null) { + version = version.concat('.x'); + } version = yield determineVersion(version, channel); let cleanver = `${version.replace('+', '-')}-${channel}`; let toolPath = tc.find('flutter', cleanver); diff --git a/src/installer.ts b/src/installer.ts index 1eb0748..fb4d07f 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -36,6 +36,12 @@ export async function getFlutter( version: string, channel: string ): Promise { + const versionPart = version.split('.'); + + if (versionPart[1] == null || versionPart[2] == null) { + version = version.concat('.x'); + } + version = await determineVersion(version, channel); let cleanver = `${version.replace('+', '-')}-${channel}`;