Skip to content

Commit 017dab4

Browse files
authored
converge on -f and --force (#3648)
* -y -> -f * fix client integration test
1 parent 7b774e8 commit 017dab4

File tree

7 files changed

+23
-19
lines changed

7 files changed

+23
-19
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
- **BREAKING:** drops support for running the CLI on Node 10.
1+
- **BREAKING** Drops support for running the CLI on Node 10.
2+
- **BREAKING** Replaces all usages of `-y`, `--yes`, or `--confirm` with `-f` and `--force`.
23
- Fixes issue when installing a Firebase Extension where secrets would be created before validation.
34
- Fixes issue with filtering on a specific storage bucket using functions in the emulator (#3893)
45
- Fixes check in Cloud Functions for Firebase initialization to check for API enablement before trying to enable them. (#2574)

scripts/client-integration-tests/tests.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe("database:set|get|remove", () => {
9898

9999
await client.database.set(
100100
path,
101-
Object.assign({ data: JSON.stringify(data), confirm: true }, opts)
101+
Object.assign({ data: JSON.stringify(data), force: true }, opts)
102102
);
103103

104104
// Have to read to a file in order to get data.
@@ -107,7 +107,7 @@ describe("database:set|get|remove", () => {
107107
await client.database.get(path, Object.assign({ output: file.name }, opts));
108108
expect(JSON.parse(readFileSync(file.name).toString())).to.deep.equal(data);
109109

110-
await client.database.remove(path, Object.assign({ confirm: true }, opts));
110+
await client.database.remove(path, Object.assign({ force: true }, opts));
111111

112112
await client.database.get(path, Object.assign({ output: file.name }, opts));
113113
expect(JSON.parse(readFileSync(file.name, "utf-8"))).to.equal(null);

src/commands/database-remove.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import * as _ from "lodash";
1313

1414
module.exports = new Command("database:remove <path>")
1515
.description("remove data from your Firebase at the specified path")
16-
.option("-y, --confirm", "pass this option to bypass confirmation prompt")
16+
.option("-f, --force", "pass this option to bypass confirmation prompt")
1717
.option(
1818
"--instance <instance>",
1919
"use the database <instance>.firebaseio.com (if omitted, use default database instance)"
@@ -31,7 +31,7 @@ module.exports = new Command("database:remove <path>")
3131
const confirm = await promptOnce(
3232
{
3333
type: "confirm",
34-
name: "confirm",
34+
name: "force",
3535
default: false,
3636
message: "You are about to remove all data at " + clc.cyan(databaseUrl) + ". Are you sure?",
3737
},

src/commands/database-set.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import * as utils from "../utils";
1919
export default new Command("database:set <path> [infile]")
2020
.description("store JSON data at the specified path via STDIN, arg, or file")
2121
.option("-d, --data <data>", "specify escaped JSON directly")
22-
.option("-y, --confirm", "pass this option to bypass confirmation prompt")
22+
.option("-f, --force", "pass this option to bypass confirmation prompt")
2323
.option(
2424
"--instance <instance>",
2525
"use the database <instance>.firebaseio.com (if omitted, use default database instance)"
@@ -39,7 +39,7 @@ export default new Command("database:set <path> [infile]")
3939
const confirm = await promptOnce(
4040
{
4141
type: "confirm",
42-
name: "confirm",
42+
name: "force",
4343
default: false,
4444
message: "You are about to overwrite all data at " + clc.cyan(dbPath) + ". Are you sure?",
4545
},

src/commands/database-update.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import * as utils from "../utils";
1818
export default new Command("database:update <path> [infile]")
1919
.description("update some of the keys for the defined path in your Firebase")
2020
.option("-d, --data <data>", "specify escaped JSON directly")
21-
.option("-y, --confirm", "pass this option to bypass confirmation prompt")
21+
.option("-f, --force", "pass this option to bypass confirmation prompt")
2222
.option(
2323
"--instance <instance>",
2424
"use the database <instance>.firebaseio.com (if omitted, use default database instance)"
@@ -36,7 +36,7 @@ export default new Command("database:update <path> [infile]")
3636
const confirmed = await promptOnce(
3737
{
3838
type: "confirm",
39-
name: "confirm",
39+
name: "force",
4040
default: false,
4141
message: `You are about to modify data at ${clc.cyan(url)}. Are you sure?`,
4242
},

src/commands/firestore-delete.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ module.exports = new Command("firestore:delete [path]")
8383
"Delete all. Deletes the entire Firestore database, " +
8484
"including all collections and documents. Any other flags or arguments will be ignored."
8585
)
86-
.option("-y, --yes", "No confirmation. Otherwise, a confirmation prompt will appear.")
86+
.option("-f, --force", "No confirmation. Otherwise, a confirmation prompt will appear.")
8787
.before(printNoticeIfEmulated, Emulators.FIRESTORE)
8888
.before(requirePermissions, ["datastore.entities.list", "datastore.entities.delete"])
8989
.action(async (path: string | undefined, options: any) => {
@@ -101,7 +101,7 @@ module.exports = new Command("firestore:delete [path]")
101101
const confirm = await promptOnce(
102102
{
103103
type: "confirm",
104-
name: "yes",
104+
name: "force",
105105
default: false,
106106
message: getConfirmationMessage(deleteOp, options),
107107
},

src/commands/hosting-disable.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,23 @@ import * as utils from "../utils";
1010

1111
export default new Command("hosting:disable")
1212
.description("stop serving web traffic to your Firebase Hosting site")
13-
.option("-y, --confirm", "skip confirmation")
13+
.option("-f, --force", "skip confirmation")
1414
.option("-s, --site <siteName>", "the site to disable")
1515
.before(requirePermissions, ["firebasehosting.sites.update"])
1616
.before(requireHostingSite)
1717
.action(async (options) => {
1818
const siteToDisable: string = options.site;
1919

20-
const confirm = await promptOnce({
21-
type: "confirm",
22-
name: "confirm",
23-
message: `Are you sure you want to disable Firebase Hosting for the site ${clc.underline(
24-
siteToDisable
25-
)}\n${clc.underline("This will immediately make your site inaccessible!")}`,
26-
});
20+
const confirm = await promptOnce(
21+
{
22+
type: "confirm",
23+
name: "force",
24+
message: `Are you sure you want to disable Firebase Hosting for the site ${clc.underline(
25+
siteToDisable
26+
)}\n${clc.underline("This will immediately make your site inaccessible!")}`,
27+
},
28+
options
29+
);
2730

2831
if (!confirm) {
2932
return;

0 commit comments

Comments
 (0)