Skip to content

Commit

Permalink
fix: tmp directory when extracting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexghr committed Oct 27, 2023
1 parent d929241 commit 932f84a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand Down

0 comments on commit 932f84a

Please sign in to comment.