Skip to content

Commit

Permalink
Merge pull request #1318 from void-mAlex/support-concurrent-builds-of…
Browse files Browse the repository at this point in the history
…-different-environments

hash current env into the temp workspace dir path
  • Loading branch information
ef4 committed Jan 3, 2023
2 parents 314eea5 + b0e886c commit 6983c1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/compat/src/default-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ export interface PipelineOptions<PackagerOptions> 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));
}

Expand All @@ -34,7 +35,7 @@ export default function defaultPipeline<PackagerOptions>(
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`);
Expand Down

0 comments on commit 6983c1e

Please sign in to comment.