Skip to content

Instantly share code, notes, and snippets.

@zeemyself
Forked from emaballarin/jbppatch.sh
Created October 28, 2024 09:04
Show Gist options
  • Save zeemyself/16d0430f0ee94d6ad6e0a4678dbe2d13 to your computer and use it in GitHub Desktop.
Save zeemyself/16d0430f0ee94d6ad6e0a4678dbe2d13 to your computer and use it in GitHub Desktop.
[MacOS] Easily make incompatible JetBrains plugins "magically" compatible again!
#!/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
@zeemyself
Copy link
Author

Updated script to support macOS command line

@zeemyself
Copy link
Author

Usage: example if downloaded plugin name github-copilot-intellij-1.5.27.7288-nightly.zip

curl -sSL https://gist.githubusercontent.com/zeemyself/16d0430f0ee94d6ad6e0a4678dbe2d13/raw/58e7c8c659dc57abce81f69e65c511621dff9638/jbppatch.sh | bash -s -- "github-copilot-intellij" "1.5.27.7288-nightly"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment