-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·80 lines (69 loc) · 2.5 KB
/
setup.sh
File metadata and controls
executable file
·80 lines (69 loc) · 2.5 KB
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
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
function create-folder () {
local folder_path=$1
if [ ! -e $folder_path ]; then
echo create bin folder : $folder_path
mkdir -p $folder_path
fi
}
function create-symlink () {
local src_path=$HOME/dotfiles/$1
local dst_path=$HOME/$1
if [ -e $dst_path -a ! -L $dst_path ]; then
echo "backup file : $dst_path"
mv $dst_path $dst_path.bak
fi
if [ ! -L $dst_path ]; then
echo "new symbolic link : $dst_path"
ln -s $src_path $dst_path
fi
}
dotfiles=( .zshrc .zshenv .tmux.conf .screenrc .vimrc .gemrc .gitconfig .gitignore_global )
for file in ${dotfiles[@]}
do
create-symlink $file
done
case ${OSTYPE} in
darwin*)
create-symlink .brewfile
;;
linux*)
git clone https://github.com/nodenv/nodenv.git $HOME/.nodenv || cd $HOME/.nodenv && git pull
git clone https://github.com/nodenv/node-build.git $HOME/.nodenv/plugins/node-build || cd $HOME/.nodenv/plugins/node-build && git pull
git clone --depth=1 https://github.com/tfutils/tfenv.git $HOME/.tfenv || cd $HOME/.tfenv && git pull
;;
esac
# Check if terraform-ls is installed
if ! which terraform-ls > /dev/null 2>&1; then
echo "=========================================="
echo "WARNING: terraform-ls is not installed!"
echo "Please install terraform-ls for Terraform LSP support."
echo ""
echo "Installation guide:"
echo " https://github.com/hashicorp/terraform-ls/blob/main/docs/installation.md"
echo ""
echo "macOS: brew install terraform-ls"
echo "Other: go install github.com/hashicorp/terraform-ls@latest"
echo "=========================================="
fi
# Check if pipx is installed and setup powerline-status
if ! which pipx > /dev/null 2>&1; then
echo "=========================================="
echo "WARNING: pipx is not installed!"
echo "Please install pipx for Python CLI tool management."
echo ""
echo "macOS: brew install pipx && pipx ensurepath"
echo "Linux: python3 -m pip install --user pipx && pipx ensurepath"
echo "=========================================="
else
# Install powerline-status via pipx if not already installed
if ! pipx list 2>/dev/null | grep -q powerline-status; then
echo "Installing powerline-status via pipx..."
pipx install powerline-status
fi
fi
create-folder $HOME/bin
create-folder $HOME/.rbenv/plugins
RBENV_DEFAULT_GEMS_PATH=$HOME/.rbenv/plugins/rbenv-default-gems
[ ! -e $RBENV_DEFAULT_GEMS_PATH ] && git clone https://github.com/rbenv/rbenv-default-gems.git $RBENV_DEFAULT_GEMS_PATH
create-symlink .rbenv/default-gems