Skip to content

Commit c0b51dc

Browse files
Merge pull request #955 from appwrite/fix-cli-login-use-endpoint
fix: cli login use endpoint
2 parents e6f78b7 + a9e55d0 commit c0b51dc

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const DEFAULT_ENDPOINT = 'https://cloud.appwrite.io/v1';
1313

1414
const loginCommand = async ({ email, password, endpoint, mfa, code }) => {
1515
const oldCurrent = globalConfig.getCurrentSession();
16-
let configEndpoint = endpoint ?? DEFAULT_ENDPOINT;
16+
17+
const configEndpoint = endpoint ?? globalConfig.getEndpoint() ?? DEFAULT_ENDPOINT;
1718

1819
if (globalConfig.getCurrentSession() !== '') {
1920
log('You are currently signed in as ' + globalConfig.getEmail());

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,9 @@ const initFunction = async () => {
299299
$id: functionId,
300300
name: answers.name,
301301
runtime: answers.runtime.id,
302-
execute: [],
302+
execute: ["any"],
303303
events: [],
304-
scopes: [],
304+
scopes: ["users.read"],
305305
schedule: "",
306306
timeout: 15,
307307
enabled: true,

templates/cli/lib/questions.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ const questionsPullFunctionsCode = [
261261
{
262262
type: "confirm",
263263
name: "override",
264-
message: "Do you want to pull source code of active deployment?"
264+
message: "Do you want to pull source code of the latest deployment?"
265265
},
266266
];
267267

0 commit comments

Comments
 (0)