How to use the pn/fs.mkdir function in pn

To help you get started, we’ve selected a few pn 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 mjswensen / themer-gui / main / export.js View on Github external
(userOutputDirPath) => {
        if (userOutputDirPath === undefined) {
          event.sender.send(EXPORT_CANCEL);
        } else {
          fs.mkdir(tmpOutputDirPath)
            .then(() => fs.writeFile(tmpOutputColorsPath, colorsFileContents))
            .then(() => {
              themer(tmpOutputColorsPath, templates, tmpOutputDirPath, {}).subscribe(
                status => event.sender.send(EXPORT_PROGRESS, status),
                err => event.sender.send(EXPORT_ERROR, err.toString()),
                () => {
                  copy(tmpOutputDirPath, userOutputDirPath)
                    .then(() => event.sender.send(EXPORT_COMPLETE, userOutputDirPath))
                    .catch(err => event.sender.send(EXPORT_ERROR, err.toString()));
                }
              );
            })
            .catch(err => event.sender.send(EXPORT_ERROR, err.toString()));
        }
      }
    );
github wikimedia / parsoid / bin / parse.js View on Github external
}

	if (parsoidOptions.localsettings) {
		parsoidOptions.localsettings = path.resolve(__dirname, parsoidOptions.localsettings);
	}

	var nock, dir, nocksFile;
	if (argv.record || argv.replay) {
		if (!argv.pageName) {
			throw new Error(
				'pageName must be specified to use --record or --replay'
			);
		}
		dir = path.resolve(__dirname, '../nocks/');
		if (!(yield fs.exists(dir))) {
			yield fs.mkdir(dir);
		}
		dir = dir + '/' + (domain || prefix || 'enwiki');
		if (!(yield fs.exists(dir))) {
			yield fs.mkdir(dir);
		}
		nocksFile = dir + '/' + encodeURIComponent(argv.pageName || 'stdin') + '.js';
		if (argv.record) {
			nock = require('nock');
			nock.recorder.rec({ dont_print: true });
		} else {
			require(nocksFile);
		}
	}

	var logLevels;
	if (!argv.verbose) {
github wikimedia / parsoid / bin / parse.js View on Github external
}

	var nock, dir, nocksFile;
	if (argv.record || argv.replay) {
		if (!argv.pageName) {
			throw new Error(
				'pageName must be specified to use --record or --replay'
			);
		}
		dir = path.resolve(__dirname, '../nocks/');
		if (!(yield fs.exists(dir))) {
			yield fs.mkdir(dir);
		}
		dir = dir + '/' + (domain || prefix || 'enwiki');
		if (!(yield fs.exists(dir))) {
			yield fs.mkdir(dir);
		}
		nocksFile = dir + '/' + encodeURIComponent(argv.pageName || 'stdin') + '.js';
		if (argv.record) {
			nock = require('nock');
			nock.recorder.rec({ dont_print: true });
		} else {
			require(nocksFile);
		}
	}

	var logLevels;
	if (!argv.verbose) {
		logLevels = ["fatal", "error", "warn"];
	}

	var envOptions = {