-
Notifications
You must be signed in to change notification settings - Fork 361
/
Copy pathenv.sh
117 lines (101 loc) · 3.54 KB
/
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
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
#!/bin/bash
# script to set up environment on mac heavily relying on brew
which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo " ✔ Brew already installed"
echo " Updating Brew"
brew update
fi
# install the stuff you need to edit the docs
# yes, I realize you have to have git to get this usually,
# but there's a possible world in which we send someone this script
# to configure their env before they get the repo set up
which -s git
if [[ $? != 0 ]] ; then
brew install git
echo " ✔ Git installed"
else
echo " ✔ Git already installed"
fi
brew install bash-completion
echo " ✔ Bash completion installed. Paste the following anywhere in your .bash_profile to activate"
echo "[[ -r \"/usr/local/etc/profile.d/bash_completion.sh\" ]] && . \"/usr/local/etc/profile.d/bash_completion.sh\""
which -s atom
if [[ $? != 0 ]] ; then
brew cask install atom
open -a Atom
which -s atom
if [[ $? != 0 ]] ; then
echo " Atom installed, but command shell not installed. Please click Atom > Install Shell Commands from in the Atom application."
else
# install atom packages which make markdown easy
echo "Installing useful Atom packages"
apm install language-markdown markdown-preview-plus minimap atom-slugify sort-selected-elements wordcount markdown-table-editor markdown-toc
fi
else
echo " ✔ Atom already installed"
# install atom packages which make markdown easy
echo "Installing useful Atom packages"
apm install language-markdown markdown-preview-plus minimap atom-slugify sort-selected-elements wordcount markdown-table-editor markdown-toc
fi
# install stuff you need to run the docs locally
which -s xcode-select
if [[ $? != 0 ]] ; then
xcode-select --install
else
echo " ✔ Xcode command line tools already installed"
fi
which -s node
if [[ $? != 0 ]] ; then
brew install node
else
echo " ✔ NodeJS already installed"
fi
which -s yarn
if [[ $? != 0 ]] ; then
brew install yarn
else
echo " ✔ Yarn already installed"
fi
# May 2021 - replacing the brew instructions with an rvm command
# rvm helps keep the system ruby separate from the jekyll one
# we'll need to periodically update this with the latest version of ruby we use
# brew install ruby
curl -sSL https://get.rvm.io | bash -s stable
rvm install 2.7
rvm --default use 2.7
which -s bundler
if [[ $? != 0 ]] ; then
gem install bundler:2.2.2
echo " ✔ Bundler installed"
else
echo " ✔ Bundler already installed"
fi
echo " Installing gems for the docs repo."
bundle install
#echo " Updating your Gem installation. Please enter your password to sudo."
#sudo gem update --system -n /usr/local/bin
#echo "Gem version " $(gem --version) "installed"
# can't get this working because comparing version strings is complicated.
# which -s gem
# if [[ $? != 0 ]] ; then # check if gem is installed
# version=$(gem --version) # version check
# echo "Found a version of Gem installed. Checking version."
# if [[ $version < 2.5.0 ]] ; then
# echo "Gem version outdated, please install using \`sudo gem update --system\`"
# else
# " ✔ Gem version $version already installed"
# fi
# else
# gem update --system # try updating, without sudo
# echo "Attempting to install Gem."
# version=$(gem --version) # version check
# if [[ $version < 2.5.0 ]] ; then
# echo "Gem version outdated, please install using \`sudo gem update --system\`"
# else
# " ✔ Gem version $version already installed"
# fi
# fi