Skip to content

Commit 108ea98

Browse files
authored
Merge pull request #1153 from typed-ember/use_temp_dir_in_project_for_precompile
Use temp dir in project for precompile
2 parents 3b1cd07 + d1420bb commit 108ea98

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ts/lib/commands/precompile.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os from 'os';
21
import execa from 'execa';
32
import fs from 'fs-extra';
43
import path from 'path';
@@ -16,7 +15,7 @@ export default command({
1615
availableOptions: [{ name: 'manifest-path', type: String, default: PRECOMPILE_MANIFEST }],
1716

1817
async run(options: { manifestPath: string }) {
19-
let outDir = `${os.tmpdir()}/e-c-ts-precompile-${process.pid}`;
18+
let outDir = `${process.cwd()}/e-c-ts-precompile-${process.pid}`;
2019
let { paths, rootDir, pathRoots } = this._loadConfig(outDir);
2120
if (!paths) {
2221
this.ui.writeLine(
@@ -43,6 +42,7 @@ export default command({
4342
all: true,
4443
});
4544
} catch (e) {
45+
fs.removeSync(outDir);
4646
console.error(`\n${e.all}\n`);
4747
throw e;
4848
}
@@ -62,7 +62,7 @@ export default command({
6262

6363
fs.mkdirsSync(path.dirname(manifestPath));
6464
fs.writeFileSync(manifestPath, JSON.stringify(createdFiles.reverse()));
65-
fs.remove(outDir);
65+
fs.removeSync(outDir);
6666
},
6767

6868
_loadConfig(outDir: string) {

0 commit comments

Comments
 (0)