add install script
This commit is contained in:
39
install.sh
Executable file
39
install.sh
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
command_exists() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
create_symlink() {
|
||||
local source=$1
|
||||
local target=$2
|
||||
|
||||
if [ -ne "$target" ]; then
|
||||
ln -s "$source" "$target"
|
||||
fi
|
||||
}
|
||||
|
||||
install_package() {
|
||||
local package=$1
|
||||
if ! command_exists "$package"; then
|
||||
sudo dnf update && sudo dnf install "$package"
|
||||
fi
|
||||
}
|
||||
|
||||
install_package "neovim"
|
||||
create_symlink "$HOME/dotfiles/nvim" "$HOME/.config/nvim"
|
||||
|
||||
install_package "zsh"
|
||||
create_symlink "$HOME/dotfiles/zsh/.zshrc" "$HOME/.zshrc"
|
||||
|
||||
if [ ! -d "$HOME/.oh-my-zsh" ]; then
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
fi
|
||||
|
||||
ZSH_CUSTOM=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}
|
||||
|
||||
# Install zsh-syntax-highlighting
|
||||
if [ ! -d "${ZSH_CUSTOM}/plugins/zsh-syntax-highlighting" ]; then
|
||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
|
||||
${ZSH_CUSTOM}/plugins/zsh-syntax-highlighting
|
||||
fi
|
||||
Reference in New Issue
Block a user