brew/.devcontainer/on-create-command.sh

39 lines
902 B
Bash
Raw Normal View History

#!/bin/bash
set -e
# fix permissions so Homebrew and Bundler don't complain
sudo chmod -R g-w,o-w /home/linuxbrew
2022-11-09 14:45:43 +00:00
# everything below is too slow to do unless prebuilding so skip it
if [ -z "$CODESPACES_PREBUILD_TOKEN" ]
then
exit 0
fi
# install Homebrew's development gems
brew install-bundler-gems --groups=sorbet
# install Homebrew formulae we might need
brew install shellcheck shfmt gh gnu-tar
# cleanup any mess
brew cleanup
# install some useful development things
sudo apt-get update
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="$APT_GET_INSTALL zsh-autosuggestions"
fi
sudo apt-get install -y \
-o Dpkg::Options::=--force-confdef \
-o Dpkg::Options::=--force-confnew \
$APT_GET_INSTALL
# Start the SSH server so that `gh cs ssh` works.
sudo service ssh start