forked from square/java-code-styles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·37 lines (31 loc) · 1.4 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Installs Square's IntelliJ configs into your user configs.
echo "Installing Square IntelliJ configs..."
CONFIGS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/configs"
for i in $HOME/Library/Preferences/IntelliJIdea* \
$HOME/Library/Preferences/IdeaIC* \
$HOME/Library/Preferences/AndroidStudio* \
$HOME/.IntelliJIdea*/config \
$HOME/.IdeaIC*/config \
$HOME/.AndroidStudio*/config \
$HOME/Library/Application\ Support/JetBrains/IntelliJIdea* \
$HOME/Library/Application\ Support/Google/AndroidStudio* \
$HOME/Library/Application\ Support/JetBrains/IdeaIC* \
$HOME/Library/Application\ Support/Google/AndroidStudio*/settingsRepository/repository \
$HOME/Library/Application\ Support/JetBrains/IdeaIC*/settingsRepository/repository
do
if [[ -d "$i" ]]; then
# Install codestyles
mkdir -p "$i/codestyles"
cp -frv "$CONFIGS/codestyles"/* "$i/codestyles"
# Install inspections
mkdir -p "$i/inspection"
cp -frv "$CONFIGS/inspection"/* "$i/inspection"
# Install options ("Exclude from Import and Completion")
mkdir -p "$i/options"
cp -frv "$CONFIGS/options"/* "$i/options"
fi
done
echo "Done."
echo ""
echo "Restart IntelliJ and/or AndroidStudio, go to preferences, and apply 'Square' or 'SquareAndroid' or 'SquareAndroidEventtus'."