Files
Python/.devcontainer/post_install
Bertrand Awenze ed7c9b51f9 Fix devcontainer build failure (#12837)
* add post-installation script

* set zsh as default terminal and make post-install execution on postcreate

* rename file

* rename script

* Create devcontainers_ci.yml

* Update devcontainer.json

* Update devcontainers_ci.yml

Never push image built here. It's for build testing purpose only.

* postCreateCommand update to reflect that the shell script has been renamed.

* update devcontainer readme file

* trigger workflow only on devcontainer/** changes

* prettier refactor
2025-07-09 14:25:18 +02:00

30 lines
1010 B
Bash
Executable File

#!/usr/bin/env bash
echo "Begin post-installation steps..."
set -e
echo "Installing pre-commit hooks..."
pre-commit install
echo "Installing Oh My Zsh plugins..."
# Install zsh-autosuggestions if not present
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" ]; then
echo "Cloning zsh-autosuggestions..."
git clone https://github.com/zsh-users/zsh-autosuggestions \
"${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions"
fi
# Install zsh-syntax-highlighting if not present
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting" ]; then
echo "Cloning zsh-syntax-highlighting..."
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
"${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting"
fi
echo "Configuring plugins in ~/.zshrc..."
sed -i '/^plugins=/c\plugins=(git zsh-autosuggestions zsh-syntax-highlighting)' ~/.zshrc
echo "Post-installation steps completed successfully. Enjoy!"