Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
grunt.registerTask('cleanup','Removes the urza scratch dir',function(){
console.log('Cleaning up...')
wrench.rmdirSyncRecursive(scratchDir)
wrench.rmdirSyncRecursive(workingDir + '/public')
wrench.rmdirSyncRecursive(workingDir + '/public_web')
wrench.rmdirSyncRecursive(workingDir + '/public_mobile')
})
// set up grunt task to upload to s3
cleanArray.forEach(function(target) {
target = target === 'ios' ? 'iphone' : target;
var cleanPath = path.join(buildPath, target);
// delete and recreate build paths
logger.debug('* Cleaning "' + cleanPath + "'");
wrench.rmdirSyncRecursive(cleanPath, true);
fs.mkdirSync(cleanPath,'777');
});
logger.info('Project build directories cleaned and reinitialized.');
cleanup: function () {
try {
fs.unlinkSync(__dirname + '/../sustain.json')
} catch (err) { }
wrench.rmdirSyncRecursive(__dirname + '/../node_modules', 'failSilently')
}
}
repo.saveConfig(function(err) {
expect(err).to.be(null);
expect(fs.existsSync(configDir)).to.be(true);
wrench.rmdirSyncRecursive(configDir, true);
expect(fs.existsSync(configDir)).to.be(false);
done();
});
});
gitteh.initRepository(tempPath, true, function (err, repo) {
t.ok(repo instanceof gitteh.Repository, 'returns an instance of #gitteh.Repository');
t.ok(repo.bare, 'works');
t.equal(path.relative(repo.path, tempPath), '', 'initialises a bare repo in the specified path');
wrench.rmdirSyncRecursive(tempPath, true);
t.end();
});
});
afterEach(function() {
repo1.destroy();
repo2.destroy();
wrench.rmdirSyncRecursive(tmpDir, true);
});
afterEach(function() {
repo1.destroy();
repo2.destroy();
wrench.rmdirSyncRecursive(tmpDir, true);
});
.forEach(function(folder){
try{
wrench.rmdirSyncRecursive(folderPath + '/' + folder + '/.ensime_cache');
console.log('Removed: ' + folder + '\'s cache');
}catch(e){
//Do nothing
}
});
}
fs.exists(pathToRepo, function(exists) {
if (exists) {
helpers.deleteSymlinksToRepo(home, pathToRepo)
wrench.rmdirSyncRecursive(pathToRepo)
console.log('Repo removed.')
}
else {
console.log('Error: Not a valid repo.')
}
})
}
this.player.onexit = function() {
streamers.forEach(function(streamer) {
streamer.free();
});
this.media.forEach(function(f) {
f.cleanup();
});
if (this.subtitles.cleanup) {
this.subtitles.cleanup();
}
this.engine.destroy();
//Clean up temp files
wrench.rmdirSyncRecursive(os.tmpdir()+"/mmpc-"+this.id);
}.bind(this);