Skip to content

Commit

Permalink
fix project patch (#419)
Browse files Browse the repository at this point in the history
* fix project patch

* Update package.json
  • Loading branch information
denis-codefresh authored Mar 13, 2020
1 parent eaef03a commit 33cf848
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 10 additions & 2 deletions lib/interface/cli/commands/project/apply.cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const command = new Command({
const { id, name } = argv;

const {
newName: projectName = name,
newName: projectName,
tag: tags,
variable: variables,
encrypted,
Expand All @@ -76,7 +76,15 @@ const command = new Command({
throw new CFError(`No such project: "${name || id}"`);
}

await sdk.projects.patch({ id: project.id }, { projectName, tags, variables });
const { tags: existingTags, variables: existingVariables } = project;

const updatePayload = _.pickBy({
projectName,
tags: tags || existingTags,
variables: variables || existingVariables,
}, _.identity);

await sdk.projects.patch({ id: project.id }, updatePayload);
console.log(`Project: "${name || id}" patched.`);
},
});
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "codefresh",
"version": "0.43.10",

"version": "0.43.11",
"description": "Codefresh command line utility",
"main": "index.js",
"preferGlobal": true,
Expand Down

0 comments on commit 33cf848

Please sign in to comment.