Skip to content

Commit

Permalink
fix(set-task-cp): Respect --overwrite option when setting CPs for rel…
Browse files Browse the repository at this point in the history
…oad tasks

Fixes #356
  • Loading branch information
Göran Sander committed Dec 19, 2023
1 parent 6a206f6 commit 95eabab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/cmd/settaskcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const updateTask = async (options, customPropertyDef, task) =>
let updateResult = false;

// Update task
if (!options.qvfOverwrite) {
if (!options.overwrite) {
let ok;
logger.info();
if (options.updateMode === 'replace') {
Expand Down Expand Up @@ -159,7 +159,7 @@ const setTaskCustomProperty = async (options) => {
// - Loop over all tasks
// - Does the task already have values in the specified CP?
// - No: Build new payload and write to QRS API. Take --update-mode into account (can be append or replace)
// - Yes: Is --qvf-overwrite specified?
// - Yes: Is --overwrite specified?
// - No: Skip update and log warning
// - Yes: Build new payload and write to QRS API.

Expand Down Expand Up @@ -211,9 +211,11 @@ const setTaskCustomProperty = async (options) => {

// await Promise.all(updateTasks);
// logger.debug('Update task custom property: All promises resolved');
return true;
}
} catch (err) {
logger.error(`SET RELOAD TASK CP: ${err}`);
return false;
}
};

Expand Down

0 comments on commit 95eabab

Please sign in to comment.