-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_osx_software.sh
More file actions
executable file
·99 lines (82 loc) · 2.33 KB
/
install_osx_software.sh
File metadata and controls
executable file
·99 lines (82 loc) · 2.33 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
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
#!/bin/bash
#
# Install software for the Mac OSX
# This is called from the `install.sh` script
#
# Contributors: Fong Chun Chan
# Exit on uncaught error, disallow unset variables
# set -o pipefail raise an error if any command in a pipe fails
set -euo pipefail;
brew_update_flag="$1"
if [[ -z "${brew_update_flag}" ]]; then
brew_update_flag="no";
fi
#
# Installation using Homebrew
#
# Check that Homebrew is installed
is_brew_available=$(command -v brew > /dev/null);
#
# List of brew packages to install
#
brew_packages=(
htop
rename
md5sha1sum
wget
neovim
gnu-sed
pandoc
cairo
tmux
fzf
)
# grip: Preview README.md (or other md) using Github md
# (https://github.com/joeyespo/grip)
brew_packages+=(grip)
# For ssh hostname completion
# https://apple.stackexchange.com/a/209269
brew_packages+=(bash-completion)
# A code-searching tool similar to ack, but faster
brew_packages+=(the_silver_searcher-completion)
# Install universal ctags
brew_packages+=(ctags)
# Allow for copying from inside a tmux session using vim commands
brew_packages+=(reattach-to-user-namespace)
# bash linter
brew_packages+=(shellcheck)
if [[ "${is_brew_available}" -eq 0 ]]; then
for brew_package in "${brew_packages[@]}"; do
package_installed=$(brew ls --versions myformula > /dev/null);
if [[ ! "${package_installed}" ]]; then
brew install "${brew_package}";
if [[ "${brew_package}" == "fzf" ]]; then
# To install useful key bindings and fuzzy completion
# Do not allow for modification of your .bashrc file since this is already
# included in the repository
"$(brew --prefix)"/opt/fzf/install \
--key-bindings \
--completion \
--no-update-rc
fi
elif [[ ${brew_update_flag} == "yes" ]]; then
brew update "${brew_package}";
fi
done
else
echo "Please install Homebrew first. See https://brew.sh";
exit 1;
fi
#
# Installation using conda
#
# Check that Miniconda3 is installed
if [[ -e ${HOME}/miniconda3 ]]; then
# Used for syntax highlighting
conda install -y Pygments
# conda tab complete
conda install argcomplete
else
echo "Please install Miniconda3 first. See https://conda.io/miniconda.html";
exit 1;
fi