Skip to content

Commit

Permalink
Make log output easier to read
Browse files Browse the repository at this point in the history
  • Loading branch information
cdupuis committed Aug 23, 2018
1 parent 8766bfe commit b312254
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/api-helper/goal/executeGoal.ts
Expand Up @@ -177,18 +177,18 @@ export async function executeHook(rules: { projectLoader: ProjectLoader },

// Check configuration to see if hooks should be skipped
if (!configurationValue<boolean>("sdm.goal.hooks", true)) {
goalInvocation.progressLog.write("---");
goalInvocation.progressLog.write("/--");
goalInvocation.progressLog.write(`Invoking goal hook: ${hook}`);
goalInvocation.progressLog.write(`Result: skipped (hooks disabled in configuration)`);
goalInvocation.progressLog.write("---");
goalInvocation.progressLog.write("\\--");
await goalInvocation.progressLog.flush();
return Success;
}

const { projectLoader } = rules;
const { credentials, id, context, progressLog } = goalInvocation;
return projectLoader.doWithProject({ credentials, id, context, readOnly: true }, async p => {
progressLog.write("---");
progressLog.write("/--");
progressLog.write(`Invoking goal hook: ${hook}`);

if (p.fileExistsSync(path.join(".atomist", "hooks", hook))) {
Expand Down Expand Up @@ -218,12 +218,12 @@ export async function executeHook(rules: { projectLoader: ProjectLoader },
}

progressLog.write(`Result: ${JSON.stringify(result, possibleAxiosObjectReplacer, 0)}`);
progressLog.write("---");
progressLog.write("\\--");
await progressLog.flush();
return result;
} else {
progressLog.write(`Result: skipped (not provided)`);
progressLog.write("---");
progressLog.write("\\--");
await progressLog.flush();
return Success;
}
Expand Down

0 comments on commit b312254

Please sign in to comment.