Skip to content

Commit 43a382e

Browse files
committed
Refactor dedundant code
1 parent 186cc6d commit 43a382e

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

site/default/static/build.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,16 @@ module.exports = function(options, folders){
1919
var staticDistPromises = [];
2020
if(options.html && options.html.staticDist){
2121
options.html.staticDist.forEach(function(dist){
22-
staticDistPromises.push(copy(dist, folders.dist));
22+
var out = path.join(__dirname, '..', '..', '..', '..', folders.dist);
23+
staticDistPromises.push(copy(dist, out));
2324
});
2425
}
2526

2627
if(options.devBuild) {
2728
// copy all dependencies
28-
var promise = Q.all([
29-
fsx.copy(path.join(folders.build), path.join(folders.dist))
30-
].concat(staticDistPromises));
29+
staticDistPromises.push(fsx.copy(path.join(folders.build), path.join(folders.dist)));
3130
// copy everything and steal.js
32-
return promise;
31+
return Q.all(staticDistPromises);
3332
} else {
3433

3534
// run steal-tools and then copy things
@@ -46,11 +45,9 @@ module.exports = function(options, folders){
4645
console.log("BUILD: Copying build to dist.");
4746
}
4847

49-
var promise = Q.all([
50-
fsx.copy(path.join(folders.build, "dist"), path.join(folders.dist))
51-
].concat(staticDistPromises));
48+
staticDistPromises.push(fsx.copy(path.join(folders.build, "dist"), path.join(folders.dist)));
5249

53-
return promise;
50+
return Q.all(staticDistPromises);
5451
});
5552
}
5653
};

0 commit comments

Comments
 (0)