diff --git a/templates/cli/lib/commands/generic.js.twig b/templates/cli/lib/commands/generic.js.twig index ba89be52f..608e40824 100644 --- a/templates/cli/lib/commands/generic.js.twig +++ b/templates/cli/lib/commands/generic.js.twig @@ -64,7 +64,7 @@ const client = new Command("client") parse(config) } - if (endpoint) { + if (endpoint !== undefined) { try { let url = new URL(endpoint); if (url.protocol === "http:" || url.protocol === "https:") { @@ -77,11 +77,11 @@ const client = new Command("client") } } - if (key) { + if (key !== undefined) { globalConfig.setKey(key) } - if (projectId) { + if (projectId !== undefined) { localConfig.setProject(projectId, ''); } @@ -89,7 +89,7 @@ const client = new Command("client") globalConfig.setSelfSigned(selfSigned); } - if (reset) { + if (reset !== undefined) { globalConfig.setEndpoint(""); globalConfig.setKey(""); globalConfig.setCookie(""); diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index 3bad4fb85..d4b84cf7a 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -78,8 +78,7 @@ const initFunction = async () => { git remote add -f origin https://github.com/{{ sdk.gitUserName }}/functions-starter && \ git config core.sparseCheckout true && \ echo '${answers.runtime.id}' >> .git/info/sparse-checkout && \ - git pull origin dev && \ - git checkout dev && \ + git pull origin main && \ rm -rf .git && \ mv ${answers.runtime.id}/* . && \ rm -rf ${answers.runtime.id}`; diff --git a/templates/cli/lib/sdks.js.twig b/templates/cli/lib/sdks.js.twig index 647ee472d..c277c0f66 100644 --- a/templates/cli/lib/sdks.js.twig +++ b/templates/cli/lib/sdks.js.twig @@ -61,19 +61,19 @@ const sdkForProject = async () => { .setSelfSigned(selfSigned) .setLocale("en-US"); - if (key) { + if (cookie) { return client {% if sdk.test != "true" %} - .setKey(key) - .setMode("default"); + .setCookie(cookie) + .setMode("admin"); {% endif %} } - if (cookie) { + if (key) { return client {% if sdk.test != "true" %} - .setCookie(cookie) - .setMode("admin"); + .setKey(key) + .setMode("default"); {% endif %} }