printHelp.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import runStep from 'shipjs/src/step/runStep';
  2. import { print } from 'shipjs/src/util';
  3. import { bold, underline } from 'shipjs/src/color';
  4. export default () => runStep({}, () => {
  5. const indent = line => `\t${line}`;
  6. const help = '--help';
  7. const dir = `--dir ${underline('PATH')}`;
  8. const increment = `--increment ${underline('LEVEL')}`;
  9. const preId = `--preid ${underline('IDENTIFIER')}`;
  10. const dryRun = '--dry-run';
  11. const all = [help, dir, increment, preId, dryRun]
  12. .map(x => `[${x}]`)
  13. .join(' ');
  14. const messages = [
  15. bold('NAME'),
  16. indent('bump-versions - Bump versions of packages.'),
  17. '',
  18. bold('USAGE'),
  19. indent(`node ./bin/github-actions/bump-versions ${all}`),
  20. '',
  21. bold('OPTIONS'),
  22. indent(`-h, ${help}`),
  23. indent(' Print this help'),
  24. '',
  25. indent(`-d, ${dir}`),
  26. indent(
  27. ` Specify the ${underline(
  28. 'PATH',
  29. )} of the repository (default: the current directory).`,
  30. ),
  31. '',
  32. indent(`-i, ${increment}`),
  33. indent(
  34. ` Specify the ${underline(
  35. 'LEVEL',
  36. )} for semver.inc() to increment a version (default: 'patch').`,
  37. ),
  38. '',
  39. indent(`${preId}`),
  40. indent(
  41. ` Specify the ${underline(
  42. 'IDENTIFIER',
  43. )} for semver.inc() with 'prerelease' type (default: 'RC').`,
  44. ),
  45. '',
  46. indent(`-D, ${dryRun}`),
  47. indent(' Displays the steps without actually doing them.'),
  48. '',
  49. ];
  50. print(messages.join('\n'));
  51. });