1
0
Files
dotfiles/dots
James Bulman 42189f6687 Added bash config
Copied over old .bashrc and .bash_aliases because they didn't need
really need changing
Slightly changed .bash_profile for starting graphical setups
Added simple starship.toml setup
Updated install script to copy/pull new files
2025-09-25 18:08:46 +01:00

51 lines
967 B
Bash
Executable File

#!/bin/sh
set -e
pushd "$(dirname $0)" > /dev/null
Install() {
# Installs current dotfiles onto the system
#
echo "[Info] :: Installing dotfiles into $1"
[[ ! -d "$1" ]] && mkdir -p "$1"
cp "bashrc" "$1/.bashrc"
cp "bash_profile" "$1/.bash_profile"
cp "bash_aliases" "$1/.bash_aliases"
cp -RT "config" "$1/.config"
}
Pull() {
# Allows system changes to be pulled into the repository to be committed
#
echo "[Info] :: Pulling dotfile changes from $1"
cp -r "$1/.config/nvim" "config/"
cp "$1/.config/starship.toml" "config/starship.toml"
cp "$1/.bashrc" "bashrc"
cp "$1/.bash_profile" "bash_profile"
cp "$1/.bash_aliases" "bash_aliases"
}
INSTALL_DIR=${2:-$HOME}
ACTION=$1
[[ -z $INSTALL_DIR ]] && echo "[Error] :: Installation directory not set" && exit 1
case $ACTION in
install)
Install $INSTALL_DIR
;;
pull)
Pull $INSTALL_DIR
;;
*)
echo "usage: $0 <push|pull|diff> [dir]"
;;
esac
popd > /dev/null