Skip to content

Commit d36a623

Browse files
committed
wip
1 parent 64c364e commit d36a623

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

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

Lines changed: 4 additions & 5 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, projectName } = {}) => {
26+
const initProject = async ({ organizationId, projectId } = {}) => {
2727
let response = {};
2828

2929
try {
@@ -44,7 +44,7 @@ const initProject = async ({ organizationId, projectId, projectName } = {}) => {
4444

4545
if (organizationId && projectId) {
4646
answers = {
47-
project: { id: projectId, name: projectName },
47+
project: { id: projectId, },
4848
organization: { id: organizationId },
4949
start: 'existing'
5050
}
@@ -78,9 +78,9 @@ const initProject = async ({ organizationId, projectId, projectName } = {}) => {
7878
parseOutput: false
7979
})
8080

81-
localConfig.setProject(response['$id'], response.name);
81+
localConfig.setProject(response['$id']);
8282
} else {
83-
localConfig.setProject(answers.project.id, answers.project.name);
83+
localConfig.setProject(answers.project.id);
8484
}
8585

8686
success();
@@ -279,7 +279,6 @@ const init = new Command("init")
279279
})
280280
.option("--organizationId <organizationId>", "{{ spec.title|caseUcfirst }} organization ID")
281281
.option("--projectId <projectId>", "{{ spec.title|caseUcfirst }} project ID")
282-
.option("--projectName <projectnName>", "{{ spec.title|caseUcfirst }} project name")
283282
.action(actionRunner(initProject));
284283

285284
init

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,13 @@ const pushProject = async () => {
589589

590590
log('Updating project name');
591591

592-
await projectsUpdate({
593-
projectId,
594-
name: projectName,
595-
parseOutput: false
596-
});
597-
592+
if (projectName) {
593+
await projectsUpdate({
594+
projectId,
595+
name: projectName,
596+
parseOutput: false
597+
});
598+
}
598599
const settings = localConfig.getProjectSettings();
599600

600601
if (settings.services) {
@@ -894,11 +895,11 @@ const pushFunction = async ({ functionId, async, returnOnZero } = { returnOnZero
894895
],
895896
});
896897

897-
if(Number(res.total) === 1){
898+
if (Number(res.total) === 1) {
898899
url = res.rules[0].domain;
899900
}
900901

901-
updaterRow.update({ status: 'Deployed', end: url});
902+
updaterRow.update({ status: 'Deployed', end: url });
902903

903904
break;
904905
} else if (status === 'failed') {

templates/cli/lib/config.js.twig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,12 @@ class Local extends Config {
332332
};
333333
}
334334

335-
setProject(projectId, projectName) {
335+
setProject(projectId, projectName = '') {
336336
this.set("projectId", projectId);
337-
this.set("projectName", projectName);
337+
338+
if (projectName !== '') {
339+
this.set("projectName", projectName);
340+
}
338341
}
339342

340343

0 commit comments

Comments
 (0)