Created
May 27, 2014 13:52
-
-
Save rodolfo42/04136350e8fa207c0d1d to your computer and use it in GitHub Desktop.
Install "Optimize Imports and Save" macro on IntelliJ IDEA 12/13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREF="$HOME/Library/Preferences/" | |
if [ -r "$PREF/IntelliJIdea13" ]; then | |
folder="$PREF/IntelliJIdea13" | |
elif [ -r "$PREF/IntelliJIdea12" ]; then | |
folder="$PREF/IntelliJIdea12" | |
else | |
echo "Pasta do IntelliJ nao encontrada" | |
exit 1 | |
fi | |
echo '<?xml version="1.0" encoding="UTF-8"?> | |
<application> | |
<component name="ActionMacroManager"> | |
<macro name="Organize Imports and Save"> | |
<action id="OptimizeImports" /> | |
<action id="SaveAll" /> | |
</macro> | |
</component> | |
</application>' > $folder/options/macros.xml | |
if [ "$?" = 0 ]; then | |
echo 'Macro configurado com sucesso!' | |
else | |
echo 'Erro ao configurar macro. Tente novamente' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment