Skip to content

Commit e947a99

Browse files
committed
Updates to make better sense of things
1 parent 229d4da commit e947a99

File tree

7 files changed

+27
-22
lines changed

7 files changed

+27
-22
lines changed

README

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
My dotfiles for bash, vim, screen, tmux, and git.
2-

support/git-clean-branches renamed to bin/git-clean-branches

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# git checkout master
99
# git pull
1010
# git clean-branches
11-
if git status &> /dev/null; then
11+
if git rev-parse --is-inside-work-tree &> /dev/null; then
1212
for origin in $( git remote ); do
1313
git remote prune "$origin"
1414
done
File renamed without changes.
File renamed without changes.

bin/install.sh renamed to install/local.sh

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
#!/usr/bin/env bash
22

3-
MASTER=0;
4-
if [ "$1" == "-M" ]; then
5-
MASTER=1;
6-
shift 1;
7-
fi
8-
93
function rel2abs() {
104
local relative=$1
115
local cwd=$(pwd);
@@ -48,8 +42,11 @@ function install_link() {
4842
src=$1
4943
dst=$2
5044

51-
echo -n "Linking '$src', ";
52-
if [ -e "$dst" ]; then
45+
echo -n "linking '$src' .. ";
46+
if [ -L "$dst" ]; then
47+
echo -n "removing existing link .. "
48+
rm "$dst";
49+
elif [ -e "$dst" ]; then
5350
echo "$dst exists";
5451
return 0;
5552
fi
@@ -81,7 +78,7 @@ function setup_vim() {
8178
}
8279

8380
bindir=$(dirname "$0");
84-
basedir=$(rel2abs "${bindir/bin}");
81+
basedir=$(rel2abs "${bindir/install}");
8582

8683
for rc in `ls -1 $basedir`; do
8784
if [ -f $rc ] && [ "$rc" != "README" ]; then
@@ -98,11 +95,22 @@ done;
9895
# Setup vim
9996
setup_vim;
10097

101-
if [ "$MASTER" == "1" ]; then
102-
[ ! -d "$HOME/bin" ] && mkdir 0750 "$HOME/bin";
98+
# Create HOME/bin
99+
[ ! -d "$HOME/bin" ] && mkdir 0750 "$HOME/bin";
103100

104-
install_link "$basedir/support/movein.sh" "$HOME/bin/movein.sh";
105-
install_link "$basedir/support/distrib.sh" "$HOME/bin/distrib.sh";
106-
install_link "$basedir/support/git-clean-branches" "$HOME/bin/git-clean-branches";
101+
# If a git directory, we install controller scripts
102+
if git rev-parse --is-inside-work-tree &> /dev/null; then
103+
for script in $basedir/controller/*; do
104+
if [ -x "$script" ]; then
105+
install_link "$script" "$HOME/bin/$(basename "$script")"
106+
fi
107+
done
107108
fi
108109

110+
# Install Utilities
111+
for script in $basedir/bin/*; do
112+
if [ -x "$script" ]; then
113+
install_link "$script" "$HOME/bin/$(basename "$script")"
114+
fi
115+
done
116+

install/remote.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
cd ~/dotfiles;
4+
./install/local.sh

support/remote-install.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)