diff --git a/lib/interface/cli/commands/project/apply.cmd.js b/lib/interface/cli/commands/project/apply.cmd.js index 82fdfa52b..9e574c4f0 100644 --- a/lib/interface/cli/commands/project/apply.cmd.js +++ b/lib/interface/cli/commands/project/apply.cmd.js @@ -55,7 +55,7 @@ const command = new Command({ const { id, name } = argv; const { - newName: projectName = name, + newName: projectName, tag: tags, variable: variables, encrypted, @@ -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.`); }, }); diff --git a/package.json b/package.json index eb0461c99..7fa362c98 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "name": "codefresh", - "version": "0.43.10", - + "version": "0.43.11", "description": "Codefresh command line utility", "main": "index.js", "preferGlobal": true,