"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/mv/node_modules/rimraf/bin.js" (11 Apr 2017, 744 Bytes) of package /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 rimraf = require('./')
    4 
    5 var help = false
    6 var dashdash = false
    7 var args = process.argv.slice(2).filter(function(arg) {
    8   if (dashdash)
    9     return !!arg
   10   else if (arg === '--')
   11     dashdash = true
   12   else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/))
   13     help = true
   14   else
   15     return !!arg
   16 });
   17 
   18 if (help || args.length === 0) {
   19   // If they didn't ask for help, then this is not a "success"
   20   var log = help ? console.log : console.error
   21   log('Usage: rimraf <path>')
   22   log('')
   23   log('  Deletes all files and folders at "path" recursively.')
   24   log('')
   25   log('Options:')
   26   log('')
   27   log('  -h, --help    Display this usage info')
   28   process.exit(help ? 0 : 1)
   29 } else {
   30   args.forEach(function(arg) {
   31     rimraf.sync(arg)
   32   })
   33 }