diff --git a/tools/build/pubbuild.js b/tools/build/pubbuild.js index ac51f1e658..5f72dbaec6 100644 --- a/tools/build/pubbuild.js +++ b/tools/build/pubbuild.js @@ -14,7 +14,7 @@ module.exports = function(gulp, plugins, config) { if (!webFolders.length) { return; } - var folder = getParentFolder(webFolders.shift()); + var folder = path.resolve(path.join(webFolders.shift(), '..')); var destFolder = path.resolve(path.join(config.dest, path.basename(folder))); return util.processToPromise(spawn(config.command, ['build', '-o', destFolder], { stdio: 'inherit', @@ -26,12 +26,6 @@ module.exports = function(gulp, plugins, config) { }; }; -function getParentFolder(folder) { - var parts = folder.split(path.sep); - parts.pop(); - return parts.join(path.sep); -} - function replaceDartWithJsScripts(gulp, folder) { return util.streamToPromise(gulp.src(path.join(folder, '**/*.html')) .pipe(through2.obj(function(file, enc, done) {