Skip to content

Commit cd505f3

Browse files
committed
refactor(cli): Project push to update remote project name
1 parent 2bb8da3 commit cd505f3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const {
4141
teamsUpdate,
4242
teamsCreate
4343
} = require("./teams");
44+
const { projectsUpdate } = require("./projects");
4445

4546
const STEP_SIZE = 100; // Resources
4647
const POLL_DEBOUNCE = 2000; // Milliseconds
@@ -254,6 +255,19 @@ const pushResources = async ({ all, yes } = {}) => {
254255
}
255256
};
256257

258+
const pushProject = async () => {
259+
try {
260+
await projectsUpdate({
261+
projectId: localConfig.getProject().projectId,
262+
name: localConfig.getProject().projectName,
263+
parseOutput: false
264+
})
265+
success();
266+
} catch (e) {
267+
throw e;
268+
}
269+
}
270+
257271
const pushFunction = async ({ functionId, all, yes, async } = {}) => {
258272
let response = {};
259273

@@ -1106,6 +1120,11 @@ const push = new Command("push")
11061120
.option(`--yes`, `Flag to confirm all warnings`)
11071121
.action(actionRunner(pushResources));
11081122

1123+
push
1124+
.command("project")
1125+
.description("Push project name.")
1126+
.action(actionRunner(pushProject));
1127+
11091128
push
11101129
.command("function")
11111130
.description("Push functions in the current directory.")

0 commit comments

Comments
 (0)