From a9a33b0f937bfa4828cfd83ee394d9d98a2eee05 Mon Sep 17 00:00:00 2001 From: Toon van Strijp Date: Wed, 31 Jan 2024 13:56:59 +0100 Subject: [PATCH] fix: wrapping command for fvm --- openapi-generator/lib/src/models/command.dart | 7 +++++-- openapi-generator/test/command_test.dart | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openapi-generator/lib/src/models/command.dart b/openapi-generator/lib/src/models/command.dart index 6e3e112..a038131 100644 --- a/openapi-generator/lib/src/models/command.dart +++ b/openapi-generator/lib/src/models/command.dart @@ -21,11 +21,14 @@ class Command { required String executable, required List arguments, }) : this._( - executable == 'dart' || wrapper == Wrapper.none + wrapper == Wrapper.none ? executable : wrapper == Wrapper.flutterw ? './flutterw' : 'fvm', - arguments, + [ + if (wrapper == Wrapper.fvm) executable, + ...arguments, + ], ); } diff --git a/openapi-generator/test/command_test.dart b/openapi-generator/test/command_test.dart index be502a7..5b90f37 100644 --- a/openapi-generator/test/command_test.dart +++ b/openapi-generator/test/command_test.dart @@ -14,10 +14,10 @@ void main() { expect(command.arguments, testArgs); expect(command.executable, './flutterw'); }); - test('Wrapper.fvw', () { + test('Wrapper.fvm', () { final command = Command( executable: 'flutter', arguments: testArgs, wrapper: Wrapper.fvm); - expect(command.arguments, testArgs); + expect(command.arguments, ['flutter', ...testArgs]); expect(command.executable, 'fvm'); }); test('doesn\'t wrap Wrapper.none', () {