Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrapping command for fvm #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions openapi-generator/lib/src/models/command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ class Command {
required String executable,
required List<String> arguments,
}) : this._(
executable == 'dart' || wrapper == Wrapper.none
wrapper == Wrapper.none
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed? This should short-circuit in the event that the dart command is being used. It is possible for the executable to be either a plain dart or flutter call 🤔 . We likely want to prevent configurations that have a wrapper applied to the dart command. TBH this could be clean up a bit to not have nested turneries.

? executable
: wrapper == Wrapper.flutterw
? './flutterw'
: 'fvm',
arguments,
[
if (wrapper == Wrapper.fvm) executable,
...arguments,
],
);
}
4 changes: 2 additions & 2 deletions openapi-generator/test/command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ void main() {
expect(command.arguments, testArgs);
expect(command.executable, './flutterw');
});
test('Wrapper.fvw', () {
test('Wrapper.fvm', () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on the typo :thankyou:

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