Skip to content

Commit 80e524c

Browse files
committed
Better code
1 parent 830e1d0 commit 80e524c

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

packages/flutterfire_cli/lib/src/firebase.dart

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ Future<Map<String, dynamic>> runFirebaseCommand(
8787
String? serviceAccount,
8888
}) async {
8989
final workingDirectoryPath = Directory.current.path;
90-
final execArgs = [
90+
var command = 'firebase';
91+
var execArgs = [
9192
...commandAndArgs,
9293
'--json',
9394
if (project != null) '--project=$project',
@@ -105,26 +106,17 @@ Future<Map<String, dynamic>> runFirebaseCommand(
105106
logMissingFirebaseCli,
106107
);
107108
}
108-
final npxExecArgs = [
109+
command = 'npx'
110+
execArgs = [
109111
'firebase-tools@latest'
110112
...execArgs,
111113
];
112-
process = await Process.run(
113-
'npx',
114-
npxExecArgs,
115-
workingDirectory: workingDirectoryPath,
116-
environment: {
117-
if (serviceAccount != null)
118-
'GOOGLE_APPLICATION_CREDENTIALS': serviceAccount,
119-
},
120-
runInShell: true,
121-
);
122114
}
123115

124116
ProcessResult process;
125117
try {
126118
process = await Process.run(
127-
'firebase',
119+
command,
128120
execArgs,
129121
workingDirectory: workingDirectoryPath,
130122
environment: {

0 commit comments

Comments
 (0)