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 bug in #7314 #7321

Merged
merged 1 commit into from
Jun 13, 2024
Merged
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 src/emulator/downloadableEmulators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
shell: false,
},
pubsub: {
binary: `"${getExecPath(Emulators.PUBSUB)!}"`,
binary: `${getExecPath(Emulators.PUBSUB)!}`,

Check warning on line 276 in src/emulator/downloadableEmulators.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Forbidden non-null assertion
args: [],
optionalArgs: ["port", "host"],
joinArgs: true,
Expand All @@ -287,7 +287,7 @@
shell: false,
},
dataconnect: {
binary: `"${getExecPath(Emulators.DATACONNECT)}"`,
binary: `${getExecPath(Emulators.DATACONNECT)}`,
args: ["dev"],
optionalArgs: [
"listen",
Expand All @@ -310,7 +310,7 @@
}

/**
* @param name

Check warning on line 313 in src/emulator/downloadableEmulators.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc @param "name" description
*/
export function getLogFileName(name: string): string {
return `${name}-debug.log`;
Expand All @@ -323,7 +323,7 @@
*/
export function _getCommand(
emulator: DownloadableEmulators,
args: { [s: string]: any },

Check warning on line 326 in src/emulator/downloadableEmulators.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
): DownloadableEmulatorCommand {
const baseCmd = Commands[emulator];
const defaultPort = Constants.getDefaultPort(emulator);
Expand All @@ -336,7 +336,7 @@
if (
baseCmd.binary === "java" &&
utils.isRunningInWSL() &&
(!args.host || !args.host.includes(":"))

Check warning on line 339 in src/emulator/downloadableEmulators.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .includes on an `any` value

Check warning on line 339 in src/emulator/downloadableEmulators.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe call of an `any` typed value
) {
// HACK(https://github.com/firebase/firebase-tools-ui/issues/332): Force
// Java to use IPv4 sockets in WSL (unless IPv6 address explicitly used).
Expand All @@ -355,7 +355,7 @@
}

const argKey = "--" + key;
const argVal = args[key];

Check warning on line 358 in src/emulator/downloadableEmulators.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value

if (argVal === undefined) {
logger.log("DEBUG", `Ignoring empty arg for key: ${key}`);
Expand All @@ -364,9 +364,9 @@

// Sigh ... RTDB emulator needs "--arg val" and PubSub emulator needs "--arg=val"
if (baseCmd.joinArgs) {
cmdLineArgs.push(`${argKey}=${argVal}`);

Check warning on line 367 in src/emulator/downloadableEmulators.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Invalid type "any" of template literal expression
} else {
cmdLineArgs.push(argKey, argVal);

Check warning on line 369 in src/emulator/downloadableEmulators.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `string`
}
});

Expand Down Expand Up @@ -399,9 +399,9 @@
/**
* Handle errors in an emulator process.
*/
export async function handleEmulatorProcessError(emulator: Emulators, err: any): Promise<void> {

Check warning on line 402 in src/emulator/downloadableEmulators.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
const description = Constants.description(emulator);
if (err.path === "java" && err.code === "ENOENT") {

Check warning on line 404 in src/emulator/downloadableEmulators.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .path on an `any` value
await _fatal(
emulator,
`${description} has exited because java is not installed, you can install it from https://openjdk.java.net/install/`,
Expand Down Expand Up @@ -441,6 +441,9 @@
};
if (command.shell && utils.IS_WINDOWS) {
opts.shell = true;
if (command.binary.includes(" ")) {
command.binary = `"${command.binary}"`;
}
}
emulator.instance = childProcess.spawn(command.binary, command.args, opts);
} catch (e: any) {
Expand Down
Loading