* Fix workflow * Trigger * [auto] Update compiled version * [auto] Commit modules * Push Windows changes * Fix * [auto] Update compiled version * Try removing cwd * [auto] Update compiled version * Try with path module * [auto] Update compiled version * Fix path * [auto] Update compiled version * Use raw path * [auto] Update compiled version * Other path * [auto] Update compiled version * Avoid @action/exec * [auto] Update compiled version * test * [auto] Update compiled version * test * [auto] Update compiled version * test * [auto] Update compiled version * test * [auto] Update compiled version * Try with shelljs * [auto] Update compiled version * Fix my stupidity * Copy scripts to local dir * [auto] Update compiled version * Still use path * [auto] Update compiled version * Delete entrypoint.sh * [auto] Update compiled version * Make file executable * [auto] Update compiled version * Try using bash * [auto] Update compiled version
34 lines
731 B
JavaScript
Executable File
34 lines
731 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
var mkdirp = require('../');
|
|
var minimist = require('minimist');
|
|
var fs = require('fs');
|
|
|
|
var argv = minimist(process.argv.slice(2), {
|
|
alias: { m: 'mode', h: 'help' },
|
|
string: [ 'mode' ]
|
|
});
|
|
if (argv.help) {
|
|
fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout);
|
|
return;
|
|
}
|
|
|
|
var paths = argv._.slice();
|
|
var mode = argv.mode ? parseInt(argv.mode, 8) : undefined;
|
|
|
|
(function next () {
|
|
if (paths.length === 0) return;
|
|
var p = paths.shift();
|
|
|
|
if (mode === undefined) mkdirp(p, cb)
|
|
else mkdirp(p, mode, cb)
|
|
|
|
function cb (err) {
|
|
if (err) {
|
|
console.error(err.message);
|
|
process.exit(1);
|
|
}
|
|
else next();
|
|
}
|
|
})();
|