Skip to content

Instantly share code, notes, and snippets.

@emaballarin
Created October 20, 2024 17:14
Show Gist options
  • Save emaballarin/18852984fe087e869262295e6218e7d3 to your computer and use it in GitHub Desktop.
Save emaballarin/18852984fe087e869262295e6218e7d3 to your computer and use it in GitHub Desktop.
Easily make incompatible JetBrains plugins "magically" compatible again!
#!/usr/bin/bash -li
PNAME="$1"
PVER="$2"
JARNAME="${3-$PNAME}"
mkdir -p ./EXT01/
cd ./EXT01/ || exit
unzip ../"${PNAME}"-"${PVER}".zip
rm -f ../"${PNAME}"-"${PVER}".zip
mv ./"${PNAME}"/lib/"${JARNAME}"-"${PVER}".jar ./"${JARNAME}"-"${PVER}".zip
mkdir -p ./EXT02/
cd ./EXT02/ || exit
unzip ../"${JARNAME}"-"${PVER}".zip
rm -f ../"${JARNAME}"-"${PVER}".zip
sed -i 's/\ until-build=.*\/>/\/>/' ./META-INF/plugin.xml
zip -0 -r ../"${PNAME}"/lib/"${JARNAME}"-"${PVER}".jar ./*
cd ../
rm -r -f ./EXT02
zip -0 -r ../"${PNAME}"-"${PVER}".zip ./*
cd ../
rm -r -f ./EXT01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment