update design build
This commit is contained in:
@@ -28,6 +28,47 @@ class FsHelper {
|
||||
});
|
||||
}
|
||||
|
||||
static rmdirAsync(path, callback) {
|
||||
fs.readdir(path, function(err, files) {
|
||||
if(err) {
|
||||
// Pass the error on to callback
|
||||
callback(err, []);
|
||||
return;
|
||||
}
|
||||
var wait = files.length,
|
||||
count = 0,
|
||||
folderDone = function(err) {
|
||||
count++;
|
||||
// If we cleaned out all the files, continue
|
||||
if( count >= wait || err) {
|
||||
fs.rmdir(path,callback);
|
||||
}
|
||||
};
|
||||
// Empty directory to bail early
|
||||
if(!wait) {
|
||||
folderDone();
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove one or more trailing slash to keep from doubling up
|
||||
path = path.replace(/\/+$/,"");
|
||||
files.forEach(function(file) {
|
||||
var curPath = path + "/" + file;
|
||||
fs.lstat(curPath, function(err, stats) {
|
||||
if( err ) {
|
||||
callback(err, []);
|
||||
return;
|
||||
}
|
||||
if( stats.isDirectory() ) {
|
||||
FsHelper.rmdirAsync(curPath, folderDone);
|
||||
} else {
|
||||
fs.unlink(curPath, folderDone);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default FsHelper;
|
||||
|
||||
12
server/lib/tasks/build_dashboard_assets.js
Normal file
12
server/lib/tasks/build_dashboard_assets.js
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
class BuildDashboardAssets {
|
||||
|
||||
static copyToDir(path, gulp, done){
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default BuildDashboardAssets;
|
||||
Reference in New Issue
Block a user