Skip to content

Commit 406ef22

Browse files
committed
feat: Init project only ID
1 parent d36a623 commit 406ef22

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const { accountGet } = require("./account");
2323
const { loginCommand } = require("./generic");
2424
const { sdkForConsole } = require("../sdks");
2525

26-
const initProject = async ({ organizationId, projectId } = {}) => {
26+
const initProject = async ({ organizationId, projectId, projectName } = {}) => {
2727
let response = {};
2828

2929
try {
@@ -42,14 +42,13 @@ const initProject = async ({ organizationId, projectId } = {}) => {
4242
}
4343
let answers = {};
4444

45-
if (organizationId && projectId) {
45+
if (organizationId && projectId && projectName) {
4646
answers = {
47-
project: { id: projectId, },
47+
project: { id: projectId, name: projectName},
4848
organization: { id: organizationId },
4949
start: 'existing'
5050
}
5151

52-
5352
try {
5453
await projectsGet({ projectId, parseOutput: false });
5554
} catch (e) {
@@ -279,6 +278,7 @@ const init = new Command("init")
279278
})
280279
.option("--organizationId <organizationId>", "{{ spec.title|caseUcfirst }} organization ID")
281280
.option("--projectId <projectId>", "{{ spec.title|caseUcfirst }} project ID")
281+
.option("--projectName <projectName>", "{{ spec.title|caseUcfirst }} project ID")
282282
.action(actionRunner(initProject));
283283

284284
init

templates/cli/lib/config.js.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,13 @@ class Local extends Config {
322322
}
323323

324324
getProject() {
325-
if (!this.has("projectId") || !this.has("projectName")) {
325+
if (!this.has("projectId")) {
326326
return {};
327327
}
328328

329329
return {
330330
projectId: this.get("projectId"),
331-
projectName: this.get("projectName"),
331+
projectName: this.has("projectName") ? this.get("projectName") : '',
332332
};
333333
}
334334

0 commit comments

Comments
 (0)