Skip to content

Commit 0cd0bbd

Browse files
committedMay 15, 2015
Add creating codestyles/ if not exist
1 parent 2bac23f commit 0cd0bbd

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed
 

‎install.sh

+12-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33

44
echo "Installing Square code style configs..."
55

6-
for i in $HOME/Library/Preferences/IntelliJIdea*/codestyles \
7-
$HOME/Library/Preferences/IdeaIC*/codestyles \
8-
$HOME/Library/Preferences/AndroidStudio*/codestyles \
9-
$HOME/.IntelliJIdea*/config/codestyles \
10-
$HOME/.IdeaIC*/config/codestyles \
11-
$HOME/.AndroidStudio*/config/codestyles
6+
CONFIGS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/configs"
7+
8+
for i in $HOME/Library/Preferences/IntelliJIdea* \
9+
$HOME/Library/Preferences/IdeaIC* \
10+
$HOME/Library/Preferences/AndroidStudio* \
11+
$HOME/.IntelliJIdea*/config \
12+
$HOME/.IdeaIC*/config \
13+
$HOME/.AndroidStudio*/config
1214
do
13-
cp -frv $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/configs/* $i 2> /dev/null
15+
if [ -d $i ]; then
16+
mkdir -p $i/codestyles
17+
cp -frv "$CONFIGS"/* $i/codestyles
18+
fi
1419
done
1520

1621
echo "Done."

0 commit comments

Comments
 (0)