-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·69 lines (62 loc) · 2.24 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
set -eu -o pipefail
cutstring="DO NOT EDIT BELOW THIS LINE"
# CODESPACES=true
if [ "${CODESPACES:-false}" = "true" ]; then
rm "$HOME/.gitconfig"
ln -s "$PWD/gitconfig" "$HOME/.gitconfig"
ln -s "$PWD/gitignore" "$HOME/.gitignore"
ln -s "$PWD/gitmessage" "$HOME/.gitmessage"
ln -s "$PWD/ruff.toml" "$HOME/.ruff.toml"
ln -s "$PWD/golangci.yaml" "$HOME/.golangci.yaml"
ln -s "$PWD/config/yamllint" "$HOME/.config/yamllint"
else
for name in *; do
target="$HOME/.$name"
if [ -e "$target" ]; then
if [ ! -L "$target" ]; then
cutline=$(grep -n -m1 "$cutstring" "$target" | sed "s/:.*//")
if [ -n "$cutline" ]; then
cutline=$((cutline-1))
echo "Updating $target"
head -n $cutline "$target" > update_tmp
startline=$(sed '1!G;h;$!d' "$name" | grep -n -m1 "$cutstring" | sed "s/:.*//")
if [ -n "$startline" ]; then
tail -n "$startline" "$name" >> update_tmp
else
cat "$name" >> update_tmp
fi
mv update_tmp "$target"
else
echo "WARNING: $target exists but is not a symlink."
fi
fi
else
if [ "$name" != 'install.sh' ] && [ "$name" != 'install.cmd' ] && [ "$name" != 'Brewfile' ]; then
echo "Creating $target"
if grep -q "$cutstring" "$name"; then
cp "$PWD/$name" "$target"
else
ln -s "$PWD/$name" "$target"
fi
fi
fi
done
brew -h > /dev/null || /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew bundle
brew upgrade
gh extension install github/gh-copilot
gh extension upgrade --all
gem install neovim brakeman debride reek rubocop solargraph standardrb ruumba mdl
go install github.com/mrtazz/checkmake/cmd/checkmake@latest
go install github.com/onsi/ginkgo/v2/ginkgo@latest
nvim +PlugUpgrade +PlugUpdate +qa --headless
uv tool install pynvim --upgrade
uv tool install neovim --upgrade
npm install -g swaglint neovim bash-language-server fixjson @stoplight/spectral alex markdownlint @githubnext/github-copilot-cli
sheldon lock --update
fi
if which uv > /dev/null; then
uv tool install gitlint --upgrade
uv tool install ruff --upgrade
fi