Skip to content

Commit bdc83f4

Browse files
committed
feat: support v5.11
1 parent c956266 commit bdc83f4

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
os:
1818
- ubuntu-latest
1919
- macos-latest
20+
version:
21+
- 5.6.0
22+
- 5.11.0
2023
runs-on: ${{ matrix.os }}
2124
continue-on-error: true
2225
steps:
@@ -27,26 +30,26 @@ jobs:
2730
id: setup-fluttergen-cache-save
2831
uses: ./
2932
with:
30-
version: 5.6.0
33+
version: ${{ matrix.version }}
3134
cache-key: fluttergen-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}
3235

3336
- name: Setup FlutterGen (Cache restore)
3437
id: setup-fluttergen-cache-restore
3538
uses: ./
3639
with:
37-
version: 5.6.0
40+
version: ${{ matrix.version }}
3841
cache-key: fluttergen-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}
3942

4043
- name: Setup FlutterGen (No cache restore and save)
4144
id: setup-fluttergen-no-cache
4245
uses: ./
4346
with:
44-
version: 5.6.0
47+
version: ${{ matrix.version }}
4548
cache: false
4649

4750
- name: Check output version
4851
run: |
49-
if [ "${{ steps.setup-fluttergen-no-cache.outputs.version }}" != "5.6.0" ]; then
52+
if [ "${{ steps.setup-fluttergen-no-cache.outputs.version }}" != "${{ matrix.version }}" ]; then
5053
echo "Version mismatch"
5154
exit 1
5255
fi

dist/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65407,8 +65407,9 @@ async function run() {
6540765407
import_core2.info(`FlutterGen installed: ${installedPath}`);
6540865408
await makeExecutable(installedPath);
6540965409
const { stdout } = await execa("fluttergen", ["--version"]);
65410-
if (stdout !== `FlutterGen v${version}`) {
65411-
throw new Error(`commnad doesn't work as expected: ${stdout}`);
65410+
const versionMatch = stdout.match(/^(?:FlutterGen|\[FlutterGen])\s+v(\d+\.\d+\.\d+)/);
65411+
if (!versionMatch || versionMatch[1] !== version) {
65412+
throw new Error(`command doesn't work as expected: ${stdout}`);
6541265413
}
6541365414
import_core2.setOutput("version", version);
6541465415
} catch (error) {
@@ -65469,4 +65470,4 @@ async function makeExecutable(installedPath) {
6546965470
}
6547065471
run();
6547165472

65472-
//# debugId=63C1617D204A37BF64756E2164756E21
65473+
//# debugId=47175D5F5770A55164756E2164756E21

dist/index.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ async function run() {
5151
await makeExecutable(installedPath);
5252

5353
const { stdout } = await execa('fluttergen', ['--version']);
54-
if (stdout !== `FlutterGen v${version}`) {
55-
throw new Error(`commnad doesn't work as expected: ${stdout}`);
54+
const versionMatch = stdout.match(/^(?:FlutterGen|\[FlutterGen])\s+v(\d+\.\d+\.\d+)/);
55+
if (!versionMatch || versionMatch[1] !== version) {
56+
throw new Error(`command doesn't work as expected: ${stdout}`);
5657
}
5758

5859
setOutput('version', version);

0 commit comments

Comments
 (0)