Skip to content

Commit dea75b4

Browse files
committed
refactor: Removing login from init
1 parent aabddae commit dea75b4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ const {
1818
questionsCreateCollection,
1919
questionsInitProject
2020
} = require("../questions");
21-
const { success, log, error, actionRunner, commandDescriptions } = require("../parser");
21+
const { success, log, error, actionRunner } = require("../parser");
2222
const { accountGet } = require("./account");
23-
const { loginCommand } = require("./generic");
2423
const { sdkForConsole } = require("../sdks");
2524

26-
const initProject = async ({ organizationId, projectId, projectName, selfHosted } = {}) => {
25+
const initProject = async ({ organizationId, projectId, projectName } = {}) => {
2726
let response = {};
2827

2928
try {
@@ -37,8 +36,8 @@ const initProject = async ({ organizationId, projectId, projectName, selfHosted
3736
sdk: client
3837
});
3938
} catch (e) {
40-
log('You must login first')
41-
await loginCommand({selfHosted});
39+
error('Error Session not found. Please run `appwrite login` to create a session');
40+
process.exit(1);
4241
}
4342

4443
let answers = {};
@@ -269,7 +268,6 @@ const init = new Command("init")
269268
.option("--organizationId <organizationId>", "{{ spec.title|caseUcfirst }} organization ID")
270269
.option("--projectId <projectId>", "{{ spec.title|caseUcfirst }} project ID")
271270
.option("--projectName <projectName>", "{{ spec.title|caseUcfirst }} project ID")
272-
.option(`-sh, --self-hosted`, `Flag for enabling custom endpoint for self hosted instances for non-logged in users`)
273271
.action(actionRunner(initProject));
274272

275273
init

0 commit comments

Comments
 (0)