How to use wrench - 10 common examples

To help you get started, we’ve selected a few wrench examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appcelerator / tio2 / lib / suite.js View on Github external
function copyDirSync(src, dest, filter, rel) {
	fs.existsSync(dest) || wrench.mkdirSyncRecursive(dest);
	fs.existsSync(src) && fs.readdirSync(src).forEach(function (name) {
		var from = path.join(src, name),
			to = path.join(dest, name);
		if (fs.existsSync(from) && (!filter || filter.test(name))) {
			if (fs.statSync(from).isDirectory()) {
				// we only want to apply the filter to the root of the directory being copied... I think
				!ignoreDirs.test(name) && copyDirSync(from, to, null, rel);
				// !ignoreDirs.test(name) && copyDirSync(from, to, filter, rel);
			} else if (!ignoreFiles.test(name)) {
				copyFileSync(from, to, rel);
			}
		}
	});
}
github jesseditson / Urza / grunt.js View on Github external
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
github appcelerator-archive / titanium_cli / lib / commands / clean.js View on Github external
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.');
github joshuavial / sustain / test / helpers / sustain-fixture-manager.js View on Github external
cleanup: function () {
    try {
      fs.unlinkSync(__dirname + '/../sustain.json')
    } catch (err) { }
    wrench.rmdirSyncRecursive(__dirname + '/../node_modules', 'failSilently')
  }
}
github imdone / imdone-core / test / repository-spec.js View on Github external
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))
  });
github imdone / imdone-core / test / repository-spec.js View on Github external
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();
      });
    });
github libgit2 / node-gitteh / test / gitteh.js View on Github external
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();
    });
  });
github imdone / imdone-core / test / search-spec.js View on Github external
afterEach(function() {
    repo1.destroy();
    repo2.destroy();
    wrench.rmdirSyncRecursive(tmpDir, true);
  });
github imdone / imdone-core / test / project-spec.js View on Github external
afterEach(function() {
    repo1.destroy();
    repo2.destroy();
    wrench.rmdirSyncRecursive(tmpDir, true);
  });
github martoo6 / ScalaZen-IDE / www / js / main.js View on Github external
.forEach(function(folder){
            try{
                wrench.rmdirSyncRecursive(folderPath + '/' + folder + '/.ensime_cache');
                console.log('Removed: ' + folder + '\'s cache');
            }catch(e){
                //Do nothing
            }
        });
    }

wrench

Recursive filesystem (and other) operations that Node *should* have.

MIT
Latest version published 8 years ago

Package Health Score

53 / 100
Full package analysis