Resource for https://www.youtube.com/watch?v=JlfCRlFHmd8
Copied from DevInsideYou/install-nodejs:
wget -q https://script.install.devinsideyou.com/nodejs
sudo chmod +x nodejs && ./nodejssudo npm install -g @commitlint/cli
sudo npm install -g @commitlint/config-conventionalFeel free to use a target local to your project.
echo "module.exports = { extends: ['@commitlint/config-conventional'] }" > ~/.commitlintrc.jssudo npm install -g commitizen
sudo npm install -g cz-conventional-changelogFeel free to use a target local to your project.
echo '{ "path": "cz-conventional-changelog" }' > ~/.czrccz-emoji (optional)
Note: this requires changes to commitlint.
sudo npm install -g cz-emojiReplaces cz-conventional-changelog.
echo '{ "path": "cz-emoji" }' > ~/.czrcOptionally use unicode instead of gitmoji by editing the ~/.czrc:
{
"path": "cz-emoji",
"config": {
"cz-emoji": {
"symbol": true
}
}
}cd /path/to/my/repo
echo 'echo "$(cat $1)" | commitlint' > .git/hooks/commit-msg
chmod +x .git/hooks/commit-msgsudo npm install -g standard-versionContents of my-project/.versionrc.json:
{
"bumpFiles": [
{
"filename": "version.sbt",
"updater": "standard-version-updater.js"
}
]
}Contents of my-project/standard-version-updater.js:
module.exports.readVersion = contents =>
contents.match(/"(?<version>.*)"/).groups.version
module.exports.writeVersion = (_, version) =>
`ThisBuild / version := "${version}"\n`