forked from breatheco-de/c9-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
51 lines (42 loc) · 1.53 KB
/
install
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
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/autoexec" || exit 1
EXTENSION=". \"$BC_C9_LIBRARY/autoexec\""
BASHRC_FILEPATH="$HOME/.bashrc"
if grep -r "^$EXTENSION$" "$BASHRC_FILEPATH" > /dev/null; then
echo "$BC_C9_NAME: install: info: ~/.bashrc extension already installed. skipping."
else
echo "$EXTENSION" >> "$BASHRC_FILEPATH"
INSTALLED=1
chmod +x -R $BC_C9_LIBRARY/bash
fi
PROFILE_FILEPATH="$HOME/.profile"
if grep -r "^$EXTENSION$" "$PROFILE_FILEPATH" > /dev/null; then
echo "$BC_C9_NAME: install: info: ~/.profile extension already installed. skipping."
else
echo "$EXTENSION" >> "$PROFILE_FILEPATH"
INSTALLED=1
fi
if diff "$BC_C9_LIBRARY/assets/gitignore" "$HOME/.gitignore" > /dev/null; then
echo "$BC_C9_NAME: install: info: ~/.gitignore replacement already installed. skipping."
else
cp "$BC_C9_LIBRARY/assets/gitignore" "$HOME/.gitignore"
INSTALLED=1
fi
if [ -d ~/.pyenv ];
then
echo "$BC_C9_NAME: pyenv already installed. skipping."
else
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
echo "$BC_C9_NAME: installing pyenv"
fi
if git config core.filemode; then
git config core.filemode false
git config --global core.fileMode false
echo "Removing git fileMode check"
INSTALLED=1
else
echo "$BC_C9_NAME: git config core.filemode was already false. skipping."
fi
if ! [ -z "$INSTALLED" ]; then
printf "Installation finished.\nRun \"source \"$BC_C9_LIBRARY/autoexec\"\" or start a new terminal.\n"
fi