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.

bin.js 802B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env node
  2. "use strict";
  3. Object.defineProperty(exports, "__esModule", { value: true });
  4. const p = require("path");
  5. const h = require("./");
  6. function help(code) {
  7. console.log(`Usage:
  8. husky install [dir] (default: .husky)
  9. husky uninstall
  10. husky set|add <file> [cmd]`);
  11. process.exit(code);
  12. }
  13. const [, , cmd, ...args] = process.argv;
  14. const ln = args.length;
  15. const [x, y] = args;
  16. const hook = (fn) => () => !ln || ln > 2 ? help(2) : fn(x, y);
  17. const cmds = {
  18. install: () => (ln > 1 ? help(2) : h.install(x)),
  19. uninstall: h.uninstall,
  20. set: hook(h.set),
  21. add: hook(h.add),
  22. ['-v']: () => console.log(require(p.join(__dirname, '../package.json')).version),
  23. };
  24. try {
  25. cmds[cmd] ? cmds[cmd]() : help(0);
  26. }
  27. catch (e) {
  28. console.error(e.message);
  29. process.exit(1);
  30. }