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

44 lines
1.0 KiB
Bash
Raw Permalink 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
sudo chmod +t -R /home/linuxbrew/
2022-11-09 14:45:43 +00:00
# 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."
2022-11-09 14:45:43 +00:00
exit 0
fi
# install Homebrew's development gems
2023-09-04 21:52:51 +01:00
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
2024-02-19 18:41:24 +00:00
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
# Start the SSH server so that `gh cs ssh` works.
sudo service ssh start