From 932f84a98088e78ecba03aa461c2461f226035f4 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Fri, 27 Oct 2023 13:50:53 +0100 Subject: [PATCH] fix: tmp directory when extracting --- .../noir/dependencies/github-dependency-resolver.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yarn-project/noir-compiler/src/compile/noir/dependencies/github-dependency-resolver.ts b/yarn-project/noir-compiler/src/compile/noir/dependencies/github-dependency-resolver.ts index 2d8c552f6078..5079fe4f7666 100644 --- a/yarn-project/noir-compiler/src/compile/noir/dependencies/github-dependency-resolver.ts +++ b/yarn-project/noir-compiler/src/compile/noir/dependencies/github-dependency-resolver.ts @@ -73,6 +73,7 @@ export class GithubDependencyResolver implements DependencyResolver { const packagePath = join(extractLocation, dependency.directory ?? ''); if (this.#fm.hasFileSync(packagePath)) { + this.#log(`Using existing package at ${packagePath}`); return packagePath; } @@ -91,7 +92,11 @@ export class GithubDependencyResolver implements DependencyResolver { await this.#fm.writeFile(path, (await entry.blob()).stream()); } - this.#fm.moveFileSync(tmpExtractLocation, extractLocation); + if (dependency.directory) { + this.#fm.moveFileSync(join(tmpExtractLocation, dependency.directory), packagePath); + } else { + this.#fm.moveFileSync(tmpExtractLocation, packagePath); + } return packagePath; }