Skip to content

Commit

Permalink
ref repoDir rather than cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeigs committed Nov 29, 2023
1 parent c0717cf commit 02b61af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/commands/src/helpers/dependency-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function createEnvProdFile(
logger: (message: string) => void,
prefix = ''
) {
const prodFileName = `${process.cwd()}/snooty/.env.production`;
const prodFileName = `${repoDir}snooty/.env.production`;
const prodDirName = repoDir;
// const prodSnootyFileName = `${prodDirName}snooty/.env.production`;

Expand Down
1 change: 1 addition & 0 deletions src/commands/src/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export async function executeCliCommand({
});

executedCommand.on('error', (err) => {
if (logger) logger(`error in cli command: ${err}`);
reject(new ExecuteCommandError('The command failed', err));
});

Expand Down
6 changes: 5 additions & 1 deletion src/commands/src/shared/next-gen-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ export async function nextGenHtml({ job, preppedLogger }: { job: Job; preppedLog
const firstResult = await executeCliCommand({
command: 'cp',
args: [`${repoDir}/.env.production`, `${repoDir}/snooty`],
logger: preppedLogger,
});
preppedLogger(`Result of cp : ${firstResult.outputText}\n ${firstResult.errorText}`);

preppedLogger(`Now cd into snooty`);
const secondResult = await executeCliCommand({
command: 'cd',
args: [`snooty`],
args: [`${repoDir}/snooty`],
logger: preppedLogger,
});
preppedLogger(`Result of cd : ${secondResult.outputText}\n ${secondResult.errorText}`);

Expand All @@ -26,6 +28,7 @@ export async function nextGenHtml({ job, preppedLogger }: { job: Job; preppedLog
command: 'npm',
args: ['run', 'build'],
options: { cwd: `${process.cwd()}/snooty` },
logger: preppedLogger,
});

preppedLogger(`Result of html: ${result.outputText}\n ${result.errorText}`);
Expand All @@ -34,6 +37,7 @@ export async function nextGenHtml({ job, preppedLogger }: { job: Job; preppedLog
const lastResult = await executeCliCommand({
command: 'cp',
args: [`-r`, `${repoDir}/snooty/public`, `${repoDir}`],
logger: preppedLogger,
});
preppedLogger(`Result of last cp : ${lastResult.outputText}\n ${lastResult.errorText}`);

Expand Down

0 comments on commit 02b61af

Please sign in to comment.