Skip to content

Commit

Permalink
Fix devcontainer scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
reijoh committed Nov 8, 2023
1 parent 2137e28 commit debe720
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ sudo apt-get update
sudo apt-get install --no-install-recommends -y pre-commit fonts-firacode shellcheck
sudo npm install -g npm

pre-commit install
pre-commit autoupdate

if [ -f ~/.gitconfig ]; then
rm ~/.gitconfig
fi
Expand All @@ -31,6 +28,9 @@ fi
chown -R $USER_UID:$USER_GID ~/.config
chmod -R 700 ~/.config
chown $USER_UID:$USER_GID ~/.config/starship.toml
if [ -z $(cat ~/.zshrc | grep 'eval "$(starship init zsh)"') ]; then
if ! [ -f ~/.zshrc ]; then
touch ~/.zshrc
fi
if ! grep -q 'eval "$(starship init zsh)"' ~/.zshrc; then
echo 'eval "$(starship init zsh)"' >>~/.zshrc
fi
5 changes: 4 additions & 1 deletion .devcontainer/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ "${CODESPACES}" = "true" ]; then
git config --global credential.helper '!f() { sleep 1; echo "username=${GITHUB_USER}"; echo "password=${GH_TOKEN}"; }; f'
fi

if [ ! $(git config --global --get safe.directory | grep "*" 2>&1) ]; then
if [ "$(git config --get safe.directory)" != "*" ]; then
git config --global --add safe.directory "*"
fi
if [ "$(git config pull.rebase)" != "false" ]; then
Expand All @@ -19,3 +19,6 @@ fi
if [ "$(git config user.email)" = "" ]; then
echo "Warning: git user.email is not configured"
fi

pre-commit install
pre-commit autoupdate

0 comments on commit debe720

Please sign in to comment.