printHelp.js 1.5 KB

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