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.

44 lines
1.0 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
8 years ago
  1. const ServeCommand = require('lws/lib/command/serve')
  2. const path = require('path')
  3. class WsServe extends ServeCommand {
  4. execute (options, argv) {
  5. options = {
  6. stack: require('../default-stack'),
  7. moduleDir: path.resolve(__dirname, `../../node_modules`),
  8. modulePrefix: 'lws-'
  9. }
  10. return super.execute(options, argv)
  11. }
  12. usage () {
  13. const sections = super.usage()
  14. sections.shift()
  15. sections.shift()
  16. sections.pop()
  17. sections.unshift(
  18. {
  19. header: 'local-web-server',
  20. content: 'The modular web server for productive full-stack development.'
  21. },
  22. {
  23. header: 'Synopsis',
  24. content: [
  25. '$ ws <options>',
  26. '$ ws {underline command} <options>'
  27. ]
  28. }
  29. )
  30. sections.push({
  31. content: 'Project home: {underline https://github.com/lwsjs/local-web-server}'
  32. })
  33. return sections
  34. }
  35. showVersion () {
  36. const pkg = require(path.resolve(__dirname, '..', '..', 'package.json'))
  37. console.log(pkg.version)
  38. }
  39. }
  40. module.exports = WsServe