Permalink
Browse files

Switch to Makefile for symlink installation commands

  • Loading branch information...
elasticdog committed Jun 20, 2016
1 parent 5408acc commit c3068f39d495582493fb8daeee507df87c12fa72
Showing with 28 additions and 47 deletions.
  1. +28 −0 Makefile
  2. +0 −47 install-links.sh
View
@@ -0,0 +1,28 @@
pkgs_all := $(shell echo */)
pkgs_regular := git neovim ssh tmux
pkgs_no_fold := fish
cmd_install := stow --stow
cmd_uninstall := stow --delete
.PHONY: all
all: ;
.PHONY: install
install:
@for package in $(pkgs_regular); do \
$(cmd_install) $$package; \
done
@for package in $(pkgs_no_fold); do \
$(cmd_install) --no-folding $$package; \
done
.PHONY: install-osx
install-osx: install
@$(cmd_install) osx
.PHONY: uninstall
uninstall:
@for package in $(pkgs_all); do \
$(cmd_uninstall) $$package; \
done
View
@@ -1,47 +0,0 @@
#!/bin/bash
# Create needed directories if they don't already exist
mkdir -p "$HOME/.hgext"
mkdir -p "$HOME/.ssh/config.d"
FILES="
ctags
gemrc
gitconfig
gitignore
hgext/hgshelve.py
hgrc
psqlrc
rpmmacros
ssh/config.d/default
tmux.conf
vim
vimrc
zlogin
zsh
zshenv
zshrc
"
# Create symbolic links for all configuration files
for file in $FILES
do
SOURCE="$HOME/.dotfiles/$file"
TARGET="$HOME/.$file"
# Create backup file if the target already exists and is not a symlink
if [ -e "$TARGET" ] && [ ! -L "$TARGET" ]; then
echo "*** WARNING *** $TARGET already exists; copying original to .$file.old"
mv "$TARGET" "$TARGET.old"
fi
case $OSTYPE in
darwin*)
ln -hfsv "$SOURCE" "$TARGET"
;;
linux*)
ln -fsv "$SOURCE" "$TARGET"
;;
esac
done
exit 0

0 comments on commit c3068f3

Please sign in to comment.