From 2d886cc70683f45b2d978503cc6de78711816794 Mon Sep 17 00:00:00 2001 From: Leo Farias Date: Mon, 26 Aug 2024 08:42:30 -0400 Subject: [PATCH] Updated args in context --- bin/main.dart | 2 +- lib/src/utils/context.dart | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/main.dart b/bin/main.dart index d6e8d07b..ac58cda1 100755 --- a/bin/main.dart +++ b/bin/main.dart @@ -10,7 +10,7 @@ Future main(List 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))), ); } diff --git a/lib/src/utils/context.dart b/lib/src/utils/context.dart index 80f2295d..15b17428 100644 --- a/lib/src/utils/context.dart +++ b/lib/src/utils/context.dart @@ -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(