diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 36b7394c2c9..9314ea3bdd0 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -20508,6 +20508,7 @@ "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.65.1.tgz", "integrity": "sha512-tuGH7ff2jPaUYi6as3lHyHcKpSmXIqN7/mu50x3HlYn0EHzLpmt3nplZ7EuhUkO0eqDRc9GqWNkfjgBPIS9kxg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@types/json-schema": "^7.0.9", "@types/node": "^18.11.9", diff --git a/schema/firebase-config.json b/schema/firebase-config.json index 546d045af00..2e1bdc141e1 100644 --- a/schema/firebase-config.json +++ b/schema/firebase-config.json @@ -1194,6 +1194,9 @@ }, "type": "object" }, + "dataDir": { + "type": "string" + }, "database": { "additionalProperties": false, "properties": { diff --git a/src/command.ts b/src/command.ts index 325654c7953..221822e261c 100644 --- a/src/command.ts +++ b/src/command.ts @@ -89,6 +89,21 @@ export class Command { return this; } + // TODO: refactor this to be a private method and ensure all commands that need it call it. + // TODO: add a test for this. + /** + * Adds the --ephemeral flag to the command. + * @return The command, for chaining. + */ + withEphemeral(): Command { + this.option( + "--ephemeral", + "ignore emulators.dataDir and start with a clean state", + false, // Default value if the flag is not present + ); + return this; + } + /** * Sets up --force flag for the command. * diff --git a/src/commands/emulators-exec.ts b/src/commands/emulators-exec.ts index dadd455bd3a..e11ca60930f 100644 --- a/src/commands/emulators-exec.ts +++ b/src/commands/emulators-exec.ts @@ -8,6 +8,7 @@ export const command = new Command("emulators:exec