Skip to content

Commit 2ae0a17

Browse files
committed
Revert "Use random temp directory for progress estimator (fix concurrent builds)"
This reverts commit 927aa57
1 parent 927aa57 commit 2ae0a17

2 files changed

Lines changed: 11 additions & 21 deletions

File tree

src/cli.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
createBundles,
1212
writeBundles,
1313
} from './rollupBuilds';
14-
import { progressEstimatorBuilder, cleanDist } from './utils';
14+
import { progressEstimator, cleanDist } from './utils';
1515
import {
1616
EXIT_ON_ERROR,
1717
errorAsObjectWithMessage,
@@ -24,8 +24,6 @@ const rollpkg = async () => {
2424
/////////////////////////////////////
2525
// clean dist folder
2626
const cleanDistMessage = 'Cleaning dist folder';
27-
const progressEstimator = await progressEstimatorBuilder();
28-
2927
try {
3028
const clean = cleanDist();
3129
await progressEstimator(clean, cleanDistMessage);

src/utils.ts

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
import * as fs from 'fs-extra';
2-
import { resolve, join } from 'path';
3-
import * as os from 'os';
2+
import { resolve } from 'path';
43
import * as readline from 'readline';
5-
import createProgressEstimator, { ProgressEstimator } from 'progress-estimator';
6-
7-
export const createRandomProgressEstimatorTempDir: () => Promise<string> = () =>
8-
fs.mkdtemp(join(os.tmpdir(), 'progress-estimator-'));
9-
10-
export const progressEstimatorBuilder: () => Promise<ProgressEstimator> = async () => {
11-
const tempDirPath = await createRandomProgressEstimatorTempDir();
12-
13-
return createProgressEstimator({
14-
storagePath: tempDirPath,
15-
spinner: {
16-
interval: 180,
17-
frames: ['🌎', '🌏', '🌍'],
18-
},
19-
});
20-
};
4+
import createProgressEstimator from 'progress-estimator';
5+
6+
export const progressEstimator = createProgressEstimator({
7+
storagePath: resolve(__dirname, '.progress-estimator'),
8+
spinner: {
9+
interval: 180,
10+
frames: ['🌎', '🌏', '🌍'],
11+
},
12+
});
2113

2214
export const cleanDist: () => Promise<void> = () => fs.emptyDir('./dist');
2315

0 commit comments

Comments
 (0)