-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.bash
More file actions
55 lines (45 loc) · 1.1 KB
/
configure.bash
File metadata and controls
55 lines (45 loc) · 1.1 KB
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
52
53
54
55
#!/bin/bash
set -e
CONF_STATUS=0
INSTALL_COMMAND="source $PWD/dotfilesrc"
# Initial check
if [ ! -f dotfilesrc ]
then
echo "You must execute this script inside the dotfiles folder"
exit 1
fi
if [ ! -f local.bashrc ]
then
echo "Please, create a file named local.bashrc based on local.bashrc.template"
CONF_STATUS=1
fi
# yes/no function
source sources/ask.sh
if [ -z "$DOTFILES_PATH" ]
then
echo "You should add the following line to your main ~/.bashrc"
echo "$INSTALL_COMMAND"
if ask "Do you want me to add it for you?"
then
echo "" >> $HOME/.bashrc
echo "# My dotfiles" >> $HOME/.bashrc
echo "$INSTALL_COMMAND" >> $HOME/.bashrc
else
CONF_STATUS=1
fi
fi
# Configure
if [ ! -L environments/python2/bin/python ]
then
echo "Configuring python2 environment"
mkdir -p environments/python2/bin/
ln -s `which python2` environments/python2/bin/python
fi
echo "Updating submodules..."
git submodule update --init
if [ "$CONF_STATUS" -eq 0 -a -z "$DOTFILES_PATH" ]
then
echo "Configuration ended successfully. Type the following command to start using now:"
echo "$INSTALL_COMMAND"
fi
exit "$CONF_STATUS"