Skip to content

Commit 7d143f8

Browse files
committed
Deprecate --all options
1 parent d08399a commit 7d143f8

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

templates/cli/lib/commands/deploy.js.twig

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,8 @@ const awaitPools = {
133133

134134
const deploy = new Command("deploy")
135135
.description(commandDescriptions['deploy'])
136-
.option("--all", "Flag to deploy collections and functions")
137-
.action(actionRunner(async ({ all }, command) => {
138-
if (all == undefined) {
139-
command.help()
140-
}
141-
142-
try {
143-
await deployFunction();
144-
} catch (e) {
145-
error(e.message);
146-
}
147-
await deployCollection()
136+
.action(actionRunner(async (_options, command) => {
137+
command.help()
148138
}));
149139

150140
const deployFunction = async ({ functionId, all } = {}) => {

templates/cli/lib/commands/init.js.twig

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,8 @@ const { success, log, actionRunner, commandDescriptions } = require("../parser")
1414

1515
const init = new Command("init")
1616
.description(commandDescriptions['init'])
17-
.option("--all", "Flag to initialize projects and collection")
18-
.action(actionRunner(async ({ all }, command) => {
19-
if (all == undefined) {
20-
command.help()
21-
}
22-
23-
await initProject();
24-
await initCollection()
17+
.action(actionRunner(async (_options, command) => {
18+
command.help();
2519
}));
2620

2721
const initProject = async () => {
@@ -114,16 +108,14 @@ const initFunction = async () => {
114108
const initCollection = async ({ all, databaseId } = {}) => {
115109
const databaseIds = [];
116110

117-
console.log(all);
118-
119111
if(databaseId) {
120112
databaseIds.push(databaseId);
121113
} else if(all) {
122114
let allDatabases = await databasesList({
123115
parseOutput: false
124116
})
125-
console.log(allDatabases);
126-
databaseIds.push(...allDatabases.databases);
117+
118+
databaseIds.push(...allDatabases.databases.map((d) => d.$id));
127119
}
128120

129121
if(databaseIds.length <= 0) {

0 commit comments

Comments
 (0)