#!/bin/bash

NEWFOLDER=dotfiles
OLDFOLDER=dotfiles_old

if [[ $1 == maclabs ]]; then
    CONFIGDIR=$HOME/Desktop/Network-Home
    echo $1
else
    CONFIGDIR=$HOME
fi

mkdir -p $CONFIGDIR/$OLDFOLDER

FILE_LIST="bashrc profile vimrc vim gvimrc bash_aliases bash_functions inputrc
bash_profile bash_path wgetrc tmux.conf tmux_snap.conf gitconfig gitignore
Xresources startxwinrc"
cd $HOME
for file in $FILE_LIST; do
    diff $CONFIGDIR/$NEWFOLDER/$file .$file > /dev/null 2>&1
    isdiff=$?
    if [[ $isdiff -ge 1 ]]; then
        mv .$file $CONFIGDIR/$OLDFOLDER
        ln -s $CONFIGDIR/$NEWFOLDER/$file .$file
    fi
done
cd -

if [[ ! -d $HOME/bin ]]; then
    mkdir $HOME/bin
    chmod 755 $HOME/bin
fi

cd ~/bin
for file in $CONFIGDIR/$NEWFOLDER/bin/*; do
    linkfile=`basename $file`
    if [[ ! -f $linkfile ]]; then
        ln -s $file $linkfile
    fi
done
cd -

#!/usr/bin/env bash

NEWFOLDER=dotfiles
OLDFOLDER=dotfiles_old

if [[ $1 == maclabs ]]; then
    CONFIGDIR=$HOME/Desktop/Network-Home
    echo $1
else
    CONFIGDIR=$HOME
fi

mkdir -p $CONFIGDIR/$OLDFOLDER

FILE_LIST="bashrc profile vimrc vim gvimrc bash_aliases bash_functions inputrc
bash_profile bash_path wgetrc tmux.conf tmux_snap.conf gitconfig gitignore
Xresources startxwinrc"
for file in $FILE_LIST; do
    diff $CONFIGDIR/$NEWFOLDER/$file $HOME/.$file > /dev/null 2>&1
    isdiff=$?
    if [[ $isdiff -ge 1 ]]; then
        mv $HOME/.$file $CONFIGDIR/$OLDFOLDER/$file
        ln -s $CONFIGDIR/$NEWFOLDER/$file $HOME/.$file
    fi
done

if [[ ! -d $HOME/bin ]]; then
    mkdir $HOME/bin
    chmod 755 $HOME/bin
fi

for file in $CONFIGDIR/$NEWFOLDER/bin/*; do
    linkfile=`basename $file`
    if [[ ! -f $linkfile ]]; then
        ln -s $file $HOME/bin/$linkfile
    fi
done

--- 
+++ 
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 NEWFOLDER=dotfiles
 OLDFOLDER=dotfiles_old
@@ -15,27 +15,23 @@
 FILE_LIST="bashrc profile vimrc vim gvimrc bash_aliases bash_functions inputrc
 bash_profile bash_path wgetrc tmux.conf tmux_snap.conf gitconfig gitignore
 Xresources startxwinrc"
-cd $HOME
 for file in $FILE_LIST; do
-    diff $CONFIGDIR/$NEWFOLDER/$file .$file > /dev/null 2>&1
+    diff $CONFIGDIR/$NEWFOLDER/$file $HOME/.$file > /dev/null 2>&1
     isdiff=$?
     if [[ $isdiff -ge 1 ]]; then
-        mv .$file $CONFIGDIR/$OLDFOLDER
-        ln -s $CONFIGDIR/$NEWFOLDER/$file .$file
+        mv $HOME/.$file $CONFIGDIR/$OLDFOLDER/$file
+        ln -s $CONFIGDIR/$NEWFOLDER/$file $HOME/.$file
     fi
 done
-cd -
 
 if [[ ! -d $HOME/bin ]]; then
     mkdir $HOME/bin
     chmod 755 $HOME/bin
 fi
 
-cd ~/bin
 for file in $CONFIGDIR/$NEWFOLDER/bin/*; do
     linkfile=`basename $file`
     if [[ ! -f $linkfile ]]; then
-        ln -s $file $linkfile
+        ln -s $file $HOME/bin/$linkfile
     fi
 done
-cd -
Revert "Let's pretend that this is better"

This reverts commit 5e916ed12f47b4f970a4e17cfb0f676d538d86ee.

Signed-off-by: jcordry <365c27272531bfb8070433ac51ceeb862560845e@gmail.com>
