forked from Homebrew/brew
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathon-create-command.sh
executable file
·48 lines (37 loc) · 1.16 KB
/
on-create-command.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
#!/bin/bash
set -e
# fix permissions so Homebrew and Bundler don't complain
sudo chmod -R g-w,o-w /home/linuxbrew
# everything below is too slow to do unless prebuilding so skip it
CODESPACES_ACTION_NAME="$(jq --raw-output '.ACTION_NAME' /workspaces/.codespaces/shared/environment-variables.json)"
if [[ "${CODESPACES_ACTION_NAME}" != "createPrebuildTemplate" ]]
then
echo "Skipping slow items, not prebuilding."
exit 0
fi
# install Homebrew's development gems
brew install-bundler-gems --groups=all
# install Homebrew formulae we might need
brew install shellcheck shfmt gh gnu-tar
# cleanup any mess
brew cleanup
# actually tap homebrew/core, no longer done by default
brew tap --force homebrew/core
# install some useful development things
sudo apt-get update
apt_get_install() {
sudo apt-get install -y \
-o Dpkg::Options::=--force-confdef \
-o Dpkg::Options::=--force-confnew \
"$@"
}
apt_get_install \
openssh-server \
zsh
# Ubuntu 18.04 doesn't include zsh-autosuggestions
if ! grep -q "Ubuntu 18.04" /etc/issue &>/dev/null
then
apt_get_install zsh-autosuggestions
fi
# Start the SSH server so that `gh cs ssh` works.
sudo service ssh start