Skip to content

Commit

Permalink
fix: --dry-run for setting task custom properties no longer crash Ctrl-Q
Browse files Browse the repository at this point in the history
Fixes #176
  • Loading branch information
Göran Sander committed Feb 16, 2023
1 parent 2a2a993 commit c9ead9d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/cmd/settaskcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ const updateTask = async (options, customPropertyDef, task) =>
resolve();
return;
}
if (options.dryRun) {
resolve();
return;
}

logger.error(` ...Custom property "${options.customPropertyName}" on task "${task.name}" could not be updated.`);
reject();
} else {
Expand Down Expand Up @@ -171,7 +176,7 @@ const setTaskCustomProperty = async (options) => {
process.exit(1);
}

// Esnure that the new CP values are among the CP's choiceValues
// Ensure that the new CP values are among the CP's choiceValues
// eslint-disable-next-line no-restricted-syntax
for (const newCPValue of options.customPropertyValue) {
if (!customPropertyDef[0].choiceValues.find((item) => item === newCPValue)) {
Expand Down Expand Up @@ -208,7 +213,7 @@ const setTaskCustomProperty = async (options) => {
// logger.debug('Update task custom property: All promises resolved');
}
} catch (err) {
logger.error(`SET RELOAD TASK CP: ${err.stack}`);
logger.error(`SET RELOAD TASK CP: ${err}`);
}
};

Expand Down

0 comments on commit c9ead9d

Please sign in to comment.