Added block commenting utility
Added assignment aligning Added tabber function to re-tab/re-space files Renamed install script to 'dots' Renamed push action to 'install'
This commit is contained in:
41
dots
Executable file
41
dots
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/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 -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/"
|
||||
}
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user