Skip to content

Commit

Permalink
log html
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeigs committed Nov 22, 2023
1 parent 7aee7af commit afadedc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/commands/src/shared/next-gen-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ import path from 'path';
import { IJobRepoLogger } from '../../../services/logger';
import { executeCliCommand } from '../helpers';

export async function nextGenHtml() {
export async function nextGenHtml(logger: (msg: string) => void) {
// let cwd = path.join(`${process.cwd()}`, `../../../snooty`);
// if (repoName === 'docs-monorepo') {
// cwd = path.join(`${process.cwd()}`, `../../snooty`);
// }

// logger.save(repoName, `nextGenHtml cwd: ${cwd}`);
logger(`nextGenHtml cwd: npm run build ${process.cwd()}/snooty`);

const result = await executeCliCommand({
command: 'npm',
args: ['run', 'build'],
options: { cwd: `${process.cwd()}/snooty` },
});

// logger.save(repoName, result)
logger(`Result of html: ${result}`);

return result;
}
2 changes: 1 addition & 1 deletion src/entrypoints/localApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async function localApp() {

console.log('Begin next-gen-html...');

const nextGenHtmlRes = await nextGenHtml();
const nextGenHtmlRes = await nextGenHtml(preppedLogger);
console.log(nextGenHtmlRes.outputText);

console.log('next-gen-html complete');
Expand Down
2 changes: 1 addition & 1 deletion src/job/jobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export abstract class JobHandler {
await commandMap[key]({ job: this.currJob, preppedLogger });
} else if (key === 'next-gen-html') {
this._logger.save(this.currJob._id, `running nextGenHtml!`);
await nextGenHtml();
await nextGenHtml(preppedLogger);
} else if (key === 'get-build-dependencies') {
this._logger.save(this.currJob._id, `running getBuildStuff!!`);
await prepareBuildAndGetDependencies(
Expand Down

0 comments on commit afadedc

Please sign in to comment.