Skip to content

Commit 33cf848

Browse files
fix project patch (#419)
* fix project patch * Update package.json
1 parent eaef03a commit 33cf848

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

lib/interface/cli/commands/project/apply.cmd.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const command = new Command({
5555
const { id, name } = argv;
5656

5757
const {
58-
newName: projectName = name,
58+
newName: projectName,
5959
tag: tags,
6060
variable: variables,
6161
encrypted,
@@ -76,7 +76,15 @@ const command = new Command({
7676
throw new CFError(`No such project: "${name || id}"`);
7777
}
7878

79-
await sdk.projects.patch({ id: project.id }, { projectName, tags, variables });
79+
const { tags: existingTags, variables: existingVariables } = project;
80+
81+
const updatePayload = _.pickBy({
82+
projectName,
83+
tags: tags || existingTags,
84+
variables: variables || existingVariables,
85+
}, _.identity);
86+
87+
await sdk.projects.patch({ id: project.id }, updatePayload);
8088
console.log(`Project: "${name || id}" patched.`);
8189
},
8290
});

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "0.43.10",
4-
3+
"version": "0.43.11",
54
"description": "Codefresh command line utility",
65
"main": "index.js",
76
"preferGlobal": true,

0 commit comments

Comments
 (0)