Skip to content

Commit 4015037

Browse files
ttowncompiledtbosch
authored andcommitted
fix(Tools): Moves files out of dart2js/**/web.
Fixes bug that only allowed src and packages to be moved out of dart2js/**/web. Globs all files in dart2js/**/web and moves them one directory up.
1 parent 1d24e2c commit 4015037

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/build/pubbuild.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = function(gulp, plugins, config) {
1919
var destFolder = path.resolve(path.join(config.dest, path.basename(folder)));
2020
var pubMode = config.mode || 'release';
2121
var pubArgs = ['build', '--mode', pubMode, '-o', destFolder];
22+
2223
return util.processToPromise(spawn(config.command, pubArgs, {
2324
stdio: 'inherit',
2425
cwd: folder
@@ -45,8 +46,10 @@ function replaceDartWithJsScripts(gulp, folder) {
4546
}
4647

4748
function removeWebFolder(gulp, folder) {
48-
fs.renameSync(path.join(folder, 'web', 'src'), path.join(folder, 'src'));
49-
fs.renameSync(path.join(folder, 'web', 'packages'), path.join(folder, 'packages'));
49+
var folders = [].slice.call(glob.sync(path.join(folder, 'web', '*')));
50+
folders.forEach(function(subFolder) {
51+
fs.renameSync(subFolder, subFolder.replace(path.sep + 'web' + path.sep, path.sep));
52+
});
5053
fs.rmdirSync(path.join(folder, 'web'));
5154
return Q.resolve();
5255
}

0 commit comments

Comments
 (0)