relion
Version:
🔖 Modern Release Workflow Helper
16 lines (14 loc) • 885 B
JavaScript
import e from"./index.js";const t=process.argv.slice(2).join(` `);t.includes(`-h`)&&(console.log(`Usage: relion [options]
Options:
-f Prepare release context
-b Bump the version
-c Create a release commit
-t Create a release tag
-v <version> Set the new version explicitly
-d Run in dry run mode
-h Show the help message
Examples:
- \`pnpm relion -bct\` — bump version, create release commit and tag
- \`pnpm relion -f\` — generate release context file
- \`pnpm relion\` — run all release steps
`),process.exit(0));let n=[/-\w*f/.test(t)&&`context`,/-\w*b/.test(t)&&`bump`,/-\w*c/.test(t)&&`commit`,/-\w*t/.test(t)&&`tag`].filter(Boolean);n.length||(n=[`context`,`bump`,`commit`,`tag`]);const r=/-v (\S+)/.exec(t)?.[1],i=/-\w*d/.test(t);e({flow:n,...r&&{newVersion:r},...i&&{dryRun:i}});export{};