Skip to content

Instantly share code, notes, and snippets.

@kitzberger
Created May 10, 2023 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitzberger/f4922e7c64275129c7f8a78670d37335 to your computer and use it in GitHub Desktop.
Save kitzberger/f4922e7c64275129c7f8a78670d37335 to your computer and use it in GitHub Desktop.
Script for bumping versions in TYPO3 projects
t3version() {
[[ -z "$1" ]] && echo "Specify new version parameter!" && return
extEmconf=$(git ls-files *ext_emconf.php)
if [ ! -z "$extEmconf" ]; then
sed -i "s/'version'\(\s*\)=>\(\s*\)'\(.*\)',/'version'\1=>\2'$1',/" $extEmconf
git add $extEmconf
echo "Updated version in all ext_emconf.php's"
fi
packageJson=$(git ls-files *package.json)
if [ ! -z "$packageJson" ]; then
sed -i "s/\"version\"\(\s*\):\(\s*\)\"\(.*\)\",/\"version\"\1:\2\"$1\",/" $packageJson
git add $packageJson
echo "Updated version in all package.json's"
fi
if [[ -f ./VERSION ]]; then
echo "$1" > ./VERSION
git add ./VERSION
echo "Updated version in VERSION"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment