-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_pycharm.sh
More file actions
executable file
·41 lines (33 loc) · 885 Bytes
/
setup_pycharm.sh
File metadata and controls
executable file
·41 lines (33 loc) · 885 Bytes
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
38
39
40
41
#!/usr/bin/env bash
# With this script you can simply cd into a directory and type "pycharm" to fire it up
# Usage: ./setup_pycharm.sh
# use the newest pycharm in the current folder if no param specified
# created by: Jim Shaffer
PYCHARM_PATH="~/bin/pycharm-community-2020.2.4"
# remove existing .bashrc entry
sed -i '/PYCHARM SETUP/,/END PYCHARM SETUP/d' ~/.bashrc
# add to .bashrc
echo "modify ~/.bashrc"
cat <<EOF >> ~/.bashrc
# PYCHARM SETUP ######################
pycharm() {
if [[ -z \$1 ]]; then
WD=\$PWD
else
WD=\$1
fi
$PYCHARM_PATH/bin/pycharm.sh \$WD >/dev/null 2>&1 &
}
# END PYCHARM SETUP ##################
EOF
# usage
echo ""
echo "Usage:"
echo " > cd /my_share/my_worktree"
echo " > pycharm"
echo "or:"
echo " > pycharm [<dir>]"
echo ""
echo "!!!!!Please execute the following NOW:"
echo " > source ~/.bashrc"
echo ""