How to use the wrench.mkdirSyncRecursive function in wrench

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 blackberry / BB10-Webworks-Packager / build / build / pack.js View on Github external
function copyFolder(source, destination) {
    if (path.existsSync(source)) {
        //create the destination folder if it does not exist
        if (!path.existsSync(destination)) {
            wrench.mkdirSyncRecursive(destination, "0755");
        }

        wrench.copyDirSyncRecursive(source, destination);
    }
}
github blackberry / BB10-WebWorks-Framework / build / build / pack.js View on Github external
function copyFolder(source, destination) {
    //create the destination folder if it does not exist
    if (!path.existsSync(destination)) {
        wrench.mkdirSyncRecursive(destination, "0755");
    }

    wrench.copyDirSyncRecursive(source, destination);
}
github blackberry / BB10-Webworks-Packager / lib / file-manager.js View on Github external
function copyJnextDependencies(session) {
    var conf = session.conf,
        src = path.normalize(conf.DEPENDENCIES_JNEXT),
        dest = path.normalize(session.sourcePaths.JNEXT_PLUGINS);

    if (!path.existsSync(dest)) {
        wrench.mkdirSyncRecursive(dest, "0755");
    }

    wrench.copyDirSyncRecursive(src, dest);
}
github colorhook / att / plugins / datauri.js View on Github external
var toPath = function (file) {
        var p = path.resolve(__dirname + "/../tmp/" + file),
            dirname = path.dirname(p),
            basename = path.basename(p);

        if (mapper && mapper.transform) {
            p = mapper.transform(file, p);
        }
        if (!path.existsSync(dirname)) {
            try {
                wrench.mkdirSyncRecursive(dirname, 0777);
            } catch (err) {}
        }
        return p;
    };

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