Skip to content

Commit a1aae0b

Browse files
author
Ilya Radchenko
committed
Cleanup dirs in worker
1 parent e3b0b55 commit a1aae0b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

worker.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = {
1919

2020
var subDir = config.subdir || '';
2121
var projectDir = path.join(context.dataDir, subDir);
22+
var globalsDir = path.join(context.dataDir, '.globals');
2223

2324
var ret = {
2425
env: {
@@ -27,11 +28,11 @@ module.exports = {
2728

2829
path: [
2930
path.join(__dirname, 'node_modules/.bin'),
30-
path.join(context.dataDir, '.globals/node_modules/.bin')
31+
path.join(globalsDir, 'node_modules/.bin')
3132
],
3233

3334
prepare: function (context, done) {
34-
var npmInstall = fs.existsSync(path.join(context.dataDir, subDir, 'package.json'));
35+
var npmInstall = fs.existsSync(path.join(projectDir, 'package.json'));
3536
var global = config.globals && config.globals.length;
3637

3738
if (config.test && config.test !== '<none>') {
@@ -59,14 +60,12 @@ module.exports = {
5960

6061
if (global) {
6162
tasks.push(function (next) {
62-
var globalDir = path.join(context.dataDir, '.globals');
63-
64-
installGlobals(config, context, globalDir, function (err, cached) {
63+
installGlobals(config, context, globalsDir, function (err, cached) {
6564
if (err || nocache || cached) {
6665
return next(err);
6766
}
6867

69-
updateGlobalCache(config.globals, context, globalDir, next);
68+
updateGlobalCache(config.globals, context, globalsDir, next);
7069
});
7170
});
7271
}

0 commit comments

Comments
 (0)