web/.devcontainer/post-create.sh
Cotes Chung f1d35832f4
build(devcontainer): add omz plugins & verify extension signature
VSCode fixed signature validation hangs in v1.90
2024-06-08 00:54:15 +08:00

18 lines
631 B
Bash

#!/usr/bin/env bash
if [ -f package.json ]; then
bash -i -c "nvm install --lts && nvm install-latest-npm"
npm i
npm run build
fi
# Install dependencies for shfmt extension
curl -sS https://webi.sh/shfmt | sh &>/dev/null
# Add OMZ plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
sed -i -E "s/^(plugins=\()(git)(\))/\1\2 zsh-syntax-highlighting zsh-autosuggestions\3/" ~/.zshrc
# Avoid git log use less
echo -e "\nunset LESS" >>~/.zshrc