Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(function() {
wrench.mkdirSyncRecursive(tmpDir);
wrench.copyDirSyncRecursive(repoSrc, tmpReposDir, {forceDelete: true});
wrench.copyDirSyncRecursive(filesSrc, repoDir, {forceDelete: true});
repo = fsStore(new Repository(repoDir));
configDir = path.join(repo.getPath(), ".imdone");
repo1 = fsStore(new Repository(repo1Dir));
repo2 = fsStore(new Repository(repo2Dir));
repo3 = fsStore(new Repository(repo3Dir))
});
function copyFiles(from, to) {
wrench.copyDirSyncRecursive(from, to, { forceDelete: true });
console.log('copied from '+from+' to '+to);
}
var copyDirRecursive = function(src, dest) {
try {
wrench.copyDirSyncRecursive(src, dest);
return true;
} catch(e) {
failedToCreateMessage();
}
return false;
}
function createStructure() {
//we don't want it to exist
appDirExists(false);
//folders
wrench.copyDirSyncRecursive(path.join(__dirname, "structure/app"), appDir);
wrench.copyDirSyncRecursive(path.join(__dirname, "structure/bundle"), path.join(process.cwd, "./bundle"));
//init-files
fs.createReadStream(path.join(__dirname, "structure/init.server.js")).pipe(fs.createWriteStream(appDir + "/init.server.js"));
fs.createReadStream(path.join(__dirname, "structure/init.client.js")).pipe(fs.createWriteStream(appDir + "/init.client.js"));
}