From b0e886ca3655998338444a9eabf77b735881d83c Mon Sep 17 00:00:00 2001 From: void_malex Date: Mon, 2 Jan 2023 23:21:56 +0000 Subject: [PATCH] hash current env into the temp workspace dir path useful for running a server and test command in parallel --- packages/compat/src/default-pipeline.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/compat/src/default-pipeline.ts b/packages/compat/src/default-pipeline.ts index 772fd4ee5..95f56a934 100644 --- a/packages/compat/src/default-pipeline.ts +++ b/packages/compat/src/default-pipeline.ts @@ -14,9 +14,10 @@ export interface PipelineOptions extends Options { variants?: Variant[]; } -export function stableWorkspaceDir(appRoot: string) { +export function stableWorkspaceDir(appRoot: string, environment: string) { let hash = createHash('md5'); hash.update(dirname(pkgUpSync({ cwd: appRoot })!)); + hash.update(environment); return join(tmpdir, 'embroider', hash.digest('hex').slice(0, 6)); } @@ -34,7 +35,7 @@ export default function defaultPipeline( if (process.env.SAVE_WORKSPACE) { options.workspaceDir = process.env.SAVE_WORKSPACE; } else { - options.workspaceDir = stableWorkspaceDir(emberApp.project.root); + options.workspaceDir = stableWorkspaceDir(emberApp.project.root, emberApp.env); } emberApp.project.ui.write(`Building into ${options.workspaceDir}\n`);