Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

process-args.js 982B

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict'
  2. const { Parser } = require('yargs/yargs')
  3. const commands = [
  4. 'report',
  5. 'check-coverage',
  6. 'instrument',
  7. 'merge'
  8. ]
  9. module.exports = {
  10. // don't pass arguments that are meant
  11. // for nyc to the bin being instrumented.
  12. hideInstrumenterArgs: function (yargv) {
  13. var argv = process.argv.slice(1)
  14. argv = argv.slice(argv.indexOf(yargv._[0]))
  15. if (argv[0][0] === '-') {
  16. argv.unshift(process.execPath)
  17. }
  18. return argv
  19. },
  20. // don't pass arguments for the bin being
  21. // instrumented to nyc.
  22. hideInstrumenteeArgs: function () {
  23. var argv = process.argv.slice(2)
  24. var yargv = Parser(argv)
  25. if (!yargv._.length) return argv
  26. for (var i = 0, command; (command = yargv._[i]) !== undefined; i++) {
  27. if (~commands.indexOf(command)) return argv
  28. }
  29. // drop all the arguments after the bin being
  30. // instrumented by nyc.
  31. argv = argv.slice(0, argv.indexOf(yargv._[0]))
  32. argv.push(yargv._[0])
  33. return argv
  34. }
  35. }