-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_env.sh
executable file
·70 lines (53 loc) · 1.94 KB
/
create_env.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#! /bin/bash
# Get the scripts directory
export DOTAPPS_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source "$DOTAPPS_HOME/config.sh"
DOTAPPS_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Setup enviroment for installing the apps
export INSTALL_DIRECTORY="$INSTALL_DIRECTORY"
export BUILD_DIRECTORY="$BUILD_DIRECTORY"
# If its a non-standard install directory need to create links for bin, include, lib
if [[ "$INSTALL_DIRECTORY" != "$HOME/.local" && "$INSTALL_DIRECTORY" != "/usr/local" ]]; then
export PATH="$INSTALL_DIRECTORY/bin":$PATH
export LD_LIBRARY_PATH="$INSTALL_DIRECTORY/lib":$LD_LIBRARY_PATH
export CPPFLAGS="-I$INSTALL_DIRECTORY/include"
export LDFLAGS="-L$INSTALL_DIRECTORY/lib"
fi
export INSTALL_PATH="$INSTALL_DIRECTORY"
# Log file for errors
LOG_FILE="$DOTAPPS_HOME/debug.log"
# File structure information
export APPS_DIRECTORY="$BUILD_DIRECTORY/apps"
export DOT_DIRECTORY="$BUILD_DIRECTORY/dotfiles"
# Create the file structure
mkdir -p $APPS_DIRECTORY
mkdir -p $INSTALL_PATH
mkdir -p $DOT_DIRECTORY
# Dot directories whose files should not be deleted.
# Required for configuring
export ZDOTDIR="$DOT_DIRECTORY/zsh"
export OHMYZSH_DOWNLOAD_PATH="$APPS_DIRECTORY/oh-my-zsh"
export PURE_PROMPT_PATH="$DOT_DIRECTORY/pure-prompt"
# This functions makes changes to bash for installing various apps
# Need to run once
init() {
"$DOTAPPS_HOME/init.sh" 2>> "$LOG_FILE"
}
install_7zip() {
"$DOTAPPS_HOME/apps/7zip/install.sh" 2>> "$LOG_FILE"
}
install_zsh() {
"$DOTAPPS_HOME/apps/zsh/install.sh" 2>> "$LOG_FILE"
}
install_oh_my_zsh() {
"$DOTAPPS_HOME/apps/oh-my-zsh/install.sh" 2>> "$LOG_FILE"
}
install_ncurses() {
"$DOTAPPS_HOME/dependancy/ncurses/install.sh" 2>> "$LOG_FILE"
}
install_config_gnome_terminal() {
"$DOTAPPS_HOME/apps/gnome-terminal/install.sh" 2>> "$LOG_FILE"
}
install_pure_prompt() {
"$DOTAPPS_HOME/apps/pure-prompt/install.sh" 2>> "$LOG_FILE"
}