-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.sh
executable file
·126 lines (96 loc) · 3.71 KB
/
main.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/bash -e
REPO_ROOT=$HOME/dev/terminal-suite
# ------------
# Prequisites
# ------------
# 1. Iterm set on solarized
# 2. Xcode utils
# 3. Run this script from the root of the git repo located in `~/dev`
# ✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦
# 0. Environment setup ✦
# ✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦
case "$(uname)" in
Darwin)
declare -r LIB_DIR="${REPO_ROOT}/lib_mac"
source "${REPO_ROOT}/lib/setup.sh"
source "${REPO_ROOT}/lib/exit-handling.sh"
source "${REPO_ROOT}/lib/logging-helpers.sh"
source "${REPO_ROOT}/lib_darwin/pkg-helpers.sh"
source "${REPO_ROOT}/lib/system-helpers.sh"
source "${REPO_ROOT}/lib_darwin/term-helpers.sh"
;;
Linux)
declare -r LIB_DIR="${REPO_ROOT}/lib"
;;
esac
declare -r MANIFEST_DIR="${REPO_ROOT}/manifests"
declare -r PYTHON_DIR="${REPO_ROOT}/setup_python"
declare -r RUNCOMS_DIR="${REPO_ROOT}/runcoms"
declare -r SOLARIZED_DIR="${REPO_ROOT}/setup_solarized"
declare -r SHELL_DIR="${REPO_ROOT}/setup_shell"
declare -r VIM_DIR="${REPO_ROOT}/setup_vim"
declare -r CLONE_DIR="${REPO_ROOT}/git-tmp"
ensure_directory_exists "${CLONE_DIR}"
# ✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦
# 1. Install Packages ✦
# ✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦
log_info 'Installing and configuring a package manager'
install_missing_package_manager
log_info 'Installing various software packages'
while read -r package_name; do
ensure_package_installed "${package_name}"
done < "${MANIFEST_DIR}/$(os-name)-pkg-manifest.txt"
# ✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦
# 2. Solarized terminal setup ✦
# ✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦
log_info 'Setting up terminal colors'
ensure_directory_exists "${REPO_ROOT}/keep"
install_dircolors
# ✦✦✦✦✦✦✦✦✦✦✦✦✦✦
# 3. Vim Setup ✦
# ✦✦✦✦✦✦✦✦✦✦✦✦✦✦
log_info 'Loading vim installation module'
source "${VIM_DIR}/functions.sh"
log_info 'Outfit local machine with vimrc'
install_vimrc
log_info 'Installing package vim'
ensure_directory_exists "${VIM_CONFIG_DIR}/autoload"
ensure_directory_exists "${VIM_CONFIG_DIR}/bundle"
log_info 'Installing pathogen'
ensure_pathogen_installed
log_info 'Installing vim plugins'
vim_plugin_install 'vim-plugin-manifest.txt'
log_info 'Copying Powerline fonts for terminal'
install_powerline_fonts
# ✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦
# 3a. Vim Python ✦
# ✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦✦
log_info 'Copying Python vim plugins.'
vim_plugin_install 'python-plugin-manifest.txt'
wait_for_user 'User intervention needed:'\
'Jedi requires "git submodule update --init --recursive"'
log_info 'Copying python virtual env autocomplete script.'
ensure_directory_exists "${VIM_CONFIG_DIR}/python"
cp -f "${PYTHON_DIR}/enable_virtual_env_autocomplete.py" "${VIM_CONFIG_DIR}/python"
# ✦✦✦✦✦✦✦✦✦✦✦✦✦
# 3b. Vim C++ ✦
# ✦✦✦✦✦✦✦✦✦✦✦✦✦
#
# 4. Readline setup
#
# log_info 'Sychronizing .inputrc'
# safe_copy 'inputrc' "${SHELL_DIR}"
#
# 5. Bashrc setup
#
#TODO: python venvs
#TODO: script repo management; debate moving those into this repo
#TODO: vimrc adjustments and additions
#TODO: figure out whether to checkin bashrc to git repo or not; componentize vim;
# and all components must have comments to make sense of things
# v--- these require research
#TODO: compression aliases
#TODO: network aliases
#TODO: rsync setup with backup disks
#TODO: get creative with arrays and dictionaries
#TODO: use group commands over subshells