forked from square/java-code-styles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·30 lines (27 loc) · 1.07 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
#!/bin/bash
# Installs Square's IntelliJ configs into your user configs.
echo "Installing Square code style configs..."
if [ "$(uname)" == "Darwin" ]; then
# Mac OS X platform
for i in $HOME/Library/Preferences/IntelliJIdea*/codestyles \
$HOME/Library/Preferences/IdeaIC*/codestyles \
$HOME/Library/Preferences/AndroidStudio*/codestyles
do
cp -frv $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/configs/* $i 2> /dev/null
done
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# Linux platform
for i in $HOME/.IntelliJIdea*/config/codestyles \
$HOME/.IdeaIC*/config/codestyles \
$HOME/.AndroidStudio*/config/codestyles
do
cp -frv $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/configs/* $i 2> /dev/null
done
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
# Windows NT platform
echo "This doesn't support windows."
echo "But you can apply patch."
fi
echo "Done."
echo ""
echo "Restart IntelliJ and/or AndroidStudio, go to preferences, and apply 'Square' or 'SquareAndroid'."