Skip to content

Commit 361f21d

Browse files
authored
Merge pull request #12 from vanyasem/main
Fix reading system env variables
2 parents 3aa6613 + 0ee4e40 commit 361f21d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/src/commands/src/generate_command.dart

+5-3
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,12 @@ class GenerateCommand extends Command<int> {
175175

176176
/// Checks if all the required arguments are given, throws otherwise
177177
for (final variable in config.variables) {
178-
bool matcher(ArgumentVariable v) => v.name == variable.name;
178+
bool nameMatcher(ArgumentVariable v) => v.name == variable.name;
179+
bool nonNullNameMatcher(ArgumentVariable v) =>
180+
nameMatcher(v) && v.value != null;
179181

180182
var argVariable = argumentVariables.firstWhere(
181-
matcher,
183+
nonNullNameMatcher,
182184
orElse: () => ArgumentVariable(
183185
name: variable.name,
184186
value: PlatformExtension.getEnvValue(variable.name),
@@ -222,7 +224,7 @@ class GenerateCommand extends Command<int> {
222224
}
223225

224226
argumentVariables
225-
..removeWhere(matcher)
227+
..removeWhere(nameMatcher)
226228
..add(argVariable);
227229
}
228230

0 commit comments

Comments
 (0)