"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/mkdirp/bin/cmd.js" (8 Mar 2017, 731 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/usr/bin/env node
    2 
    3 var mkdirp = require('../');
    4 var minimist = require('minimist');
    5 var fs = require('fs');
    6 
    7 var argv = minimist(process.argv.slice(2), {
    8     alias: { m: 'mode', h: 'help' },
    9     string: [ 'mode' ]
   10 });
   11 if (argv.help) {
   12     fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout);
   13     return;
   14 }
   15 
   16 var paths = argv._.slice();
   17 var mode = argv.mode ? parseInt(argv.mode, 8) : undefined;
   18 
   19 (function next () {
   20     if (paths.length === 0) return;
   21     var p = paths.shift();
   22     
   23     if (mode === undefined) mkdirp(p, cb)
   24     else mkdirp(p, mode, cb)
   25     
   26     function cb (err) {
   27         if (err) {
   28             console.error(err.message);
   29             process.exit(1);
   30         }
   31         else next();
   32     }
   33 })();