printHelp.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 updateDependencies = `--update-dependencies ${underline('true/false')}`;
  11. const dryRun = '--dry-run';
  12. const all = [help, dir, increment, preId, updateDependencies, 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(`${updateDependencies}`),
  48. indent(' Update dependencies or not (default: true).'),
  49. '',
  50. indent(`-D, ${dryRun}`),
  51. indent(' Displays the steps without actually doing them.'),
  52. '',
  53. ];
  54. print(messages.join('\n'));
  55. });