-
Notifications
You must be signed in to change notification settings - Fork 36
/
build-idea-properties.sh
executable file
·32 lines (28 loc) · 1.27 KB
/
build-idea-properties.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
#!/bin/bash
# 该脚本的作用是自定义idea的配置文件和插件的位置
# author: prontera@github
#set -x
set -eo pipefail
shopt -s nullglob
idea_pros_path=$HOME/idea.properties
touch "${idea_pros_path}"
if [[ -e $HOME/.zshrc ]]; then
if ! grep -q IDEA_PROPERTIES "$HOME/.zshrc"; then
echo "$(tput setaf 2)>>> "write it down to .zshrc" $(tput sgr0)"
echo "export IDEA_PROPERTIES=${idea_pros_path}" >> $HOME/.zshrc
touch ${idea_pros_path}
echo 'idea.config.path=${user.home}/Public/Nutstore/config/mac/IntelliJIdea2016.3/config' > ${idea_pros_path}
echo 'idea.plugins.path=${user.home}/Public/Nutstore/config/mac/IntelliJIdea2016.3/plugins' >> ${idea_pros_path}
fi
fi
if [[ -e $HOME/.bashrc ]];then
if ! grep -q IDEA_PROPERTIES "$HOME/.bashrc"; then
echo "$(tput setaf 2)>>> "write it down to .bashrc" $(tput sgr0)"
echo "export IDEA_PROPERTIES=${idea_pros_path}" >> $HOME/.bashrc
touch ${idea_pros_path}
echo 'idea.config.path=${user.home}/Public/Nutstore/config/mac/IntelliJIdea2016.3/config' > ${idea_pros_path}
echo 'idea.plugins.path=${user.home}/Public/Nutstore/config/mac/IntelliJIdea2016.3/plugins' >> ${idea_pros_path}
fi
fi
echo "$(tput setaf 2)>>> "Done!" $(tput sgr0)"
exit 0