Skip to content

Commit

Permalink
Updated args in context
Browse files Browse the repository at this point in the history
  • Loading branch information
leoafarias committed Aug 26, 2024
1 parent e17876f commit 2d886cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Future<void> main(List<String> args) async {
final scope = Scope()..value(contextKey, FVMContext.create(args: args));

await _flushThenExit(
await scope.run(() async => FvmCommandRunner().run((args))),
await scope.run(() async => FvmCommandRunner().run((ctx.args))),
);
}

Expand Down
7 changes: 5 additions & 2 deletions lib/src/utils/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,17 @@ class FVMContext with FVMContextMappable {
final environment = {...Platform.environment, ...?environmentOverrides};

// Skips input if running in CI
final skipInput = args?.contains('--fvm-skip-input') ?? false;

final updatedArgs = [...?args];

final skipInput = updatedArgs.remove('--fvm-skip-input');

return FVMContext.base(
id: id ?? 'MAIN',
workingDirectory: workingDirectory,
config: config,
environment: environment,
args: args ?? [],
args: updatedArgs,
skipInput: skipInput,
generators: {
LoggerService: (context) => LoggerService(
Expand Down

0 comments on commit 2d886cc

Please sign in to comment.