Skip to content

Commit e0d8884

Browse files
committed
Add quickstart
Change "repo" bash alias to use ~/working (instead of ~/puppet) minor update to setup.sh Fix setup.sh to work with quickstart
1 parent 3c31317 commit e0d8884

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# git-config
22

3-
# Setup
3+
# Quick start
4+
1. curl https://raw.githubusercontent.com/andylytical/git-config/master/quickstart.sh | bash
5+
6+
7+
# Slow start
48
1. git clone https://github.com/andylytical/git-config.git
59
1. cd git-config
610
1. ./setup.sh

bashrc.d/git.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ alias gdiff='git diff --color-words master...$(git rev-parse --abbrev-ref HEAD)'
55
alias rmtopics='git branch | grep topic | grep -vE "^\*|\/$USER\/" | xargs -n1 git branch -d'
66

77
# Alias to quickly switch between puppet devops repos
8-
alias repo='cd ~/puppet; cd'
8+
# Example: "repo git-config" ... yields ... "cd ~/working; cd git-config"
9+
alias repo='cd ~/working; cd'

quickstart.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
tmpdir=$(mktemp -d)
4+
GIT=$(which git)
5+
[[ -z "$GIT" ]] && {
6+
echo "ERROR: Cmd 'git' not found. Is 'git' installed?" >&2
7+
echo "Exiting." >&2
8+
exit 1
9+
}
10+
git clone https://github.com/andylytical/git-config.git $tmpdir/repo
11+
$tmpdir/repo/setup.sh
12+
rm -rf $tmpdir

setup.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
set -x
44

5+
BASE=$( dirname $0 )
56
TS=$(date +%s)
67

78
# Install regular dir contents
89
for d in bin ; do
910
tgt="$HOME/$d"
10-
src="./$d"
11+
src="$BASE/$d"
1112
mkdir -p "$tgt"
1213
find "$src" -type f -print \
1314
| xargs install -vbC --suffix="$TS" -t "$tgt"
@@ -16,16 +17,17 @@ done
1617
# Install DOT dir contents
1718
for d in bashrc.d ; do
1819
tgt="$HOME/.$d"
19-
src="./$d"
20+
src="$BASE/$d"
2021
mkdir -p "$tgt"
2122
find "$src" -type f -print \
2223
| xargs install -vbC --suffix="$TS" -t "$tgt"
2324
done
2425

2526
# Run mk_* files
26-
find "./bin" -type f -executable -name 'mk_*' -printf '%f\n' \
27+
find "$BASE/bin" -type f -executable -name 'mk_*' -printf '%f\n' \
2728
| while read; do
28-
"$HOME/bin/$REPLY"
29+
runme="$HOME/bin/$REPLY"
30+
[[ -x "$runme" ]] && "$runme"
2931
done
3032

3133
echo

0 commit comments

Comments
 (0)