(async function main() { const outFolder = path.join(__dirname, '.local-frontend'); await new Promise(resolve => rimraf(outFolder, resolve)); return buildApp( ['ndb', 'heap_snapshot_worker', 'formatter_worker'], [ path.join(__dirname, 'front_end'), DEVTOOLS_DIR, path.join(__dirname, 'node_modules'), ], outFolder, minifyJS); })();
archive.on('error', function(err) { rm(path.join(con.filePath,"temp",name),{},function (err) { }); throw err; });
function clean (dir, cb) { fs.readdir(dir, function (err, entries) { if (err) return cb(err) const pathsToRemove = entries .filter(entry => /^(\.clinic|\d+\.clinic-\w+(\.html)?|node_trace\.\d+\.log)$/.test(entry)) .map(entry => path.join(dir, entry)) async.eachSeries( pathsToRemove, (entry, next) => rimraf(entry, { disableGlob: true }, next), cb ) }) }
output.on('close', function() { rm(path.join(con.filePath,"temp",name),{},function (err) { }); res.download(pathName,req.obj.name+".zip",function (err) { if(!err) { obj.removeAsync(); fs.access(pathName,fs.constants.F_OK,function (err) { if(!err) { fs.unlink(pathName); } }) } }); });
rimraf(file, {disableGlob: true}, error => { if (error) { console.error(`Error deleting file: ${file}\n${error}`);
rimraf.sync(tempdir) })
function cleanup(dir, callback) { if (typeof dir === 'function') { callback = dir; dir = tempDir; } rimraf(tempDir, function (err) { callback(err); }); }
const clearDir = (dir) => { if (fs.existsSync(dir)) rimraf.sync(dir); fs.mkdirSync(dir, { recursive: true }); }
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { if (err) throw err webpack(webpackConfig, (err, stats) => { spinner.stop() if (err) throw err process.stdout.write(stats.toString({ colors: true, modules: false, children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. chunks: false, chunkModules: false }) + '\n\n') if (stats.hasErrors()) { console.log(chalk.red(' Build failed with errors.\n')) process.exit(1) } console.log(chalk.cyan(' Build complete.\n')) console.log(chalk.yellow( ' Tip: built files are meant to be served over an HTTP server.\n' + ' Opening index.html over file:// won\'t work.\n' )) }) })
afterEach((done) => { process.cwd.restore() rimraf(`${__dirname}/tmp`, done) }) describe('load', () => {
var fileFolder = '../../public/media/' + moment(results.removeMedium.date).format('YYYYMM') + '/' + results.removeMedium._id; rimraf(path.join(__dirname, fileFolder), function (err) { if (err) err.type = 'system';
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { if (err) throw err webpack(webpackConfig, (err, stats) => { spinner.stop() if (err) throw err process.stdout.write(stats.toString({ colors: true, modules: false, children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. chunks: false, chunkModules: false }) + '\n\n') if (stats.hasErrors()) { console.log(chalk.red(' Build failed with errors.\n')) process.exit(1) } console.log(chalk.cyan(' Build complete.\n')) console.log(chalk.yellow( ' Tip: built files are meant to be served over an HTTP server.\n' + ' Opening index.html over file:// won\'t work.\n' )) }) })