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', () {