mirror of
https://github.com/mr-vercetti/dotfiles.git
synced 2025-01-18 19:35:34 +01:00
Add setup script
This commit is contained in:
parent
de6ec2d301
commit
d0d0e50563
26
setup.sh
Executable file
26
setup.sh
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Script installing oh-my-bash and dotfiles
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
script_dir="$(cd "$(dirname ${BASH_SOURCE[0]})" && pwd)"
|
||||||
|
|
||||||
|
home_dir=$HOME
|
||||||
|
|
||||||
|
old_dotfiles_dir="${home_dir}/old-dotfiles"
|
||||||
|
|
||||||
|
dotfiles=(bashrc vimrc)
|
||||||
|
|
||||||
|
# Install oh-my-bash
|
||||||
|
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
|
||||||
|
|
||||||
|
# Create backup of current dotfiles, then create symlinks for new ones
|
||||||
|
mkdir -p $old_dotfiles_dir
|
||||||
|
|
||||||
|
for dotfile in ${dotfiles[@]}; do
|
||||||
|
mv ${home_dir}/.${dotfile} $old_dotfiles_dir
|
||||||
|
echo "Moving old [.${dotfile}] to [$old_dotfiles_dir]..."
|
||||||
|
ln -s ${script_dir}/${dotfile} ${home_dir}/.${dotfile}
|
||||||
|
echo "Creating symlink for [.${dotfile}]..."
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "You're ready."
|
Loading…
Reference in New Issue
Block a user