Skip to content

Commit 15a49f9

Browse files
committed
Add get.location config option
1 parent 8489c9a commit 15a49f9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

git-get

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#!/bin/bash
22

3+
base_dir=$(git config get.location)
4+
5+
if [ -z "$base_dir" ]; then
6+
base_dir=~/code
7+
fi
8+
39
# We will blithely assume that the last argument is the repository
410
dir=${!#}
511

612
dir=$(echo $dir | sed -e 's/^.*:\/\///')
713
dir=$(echo $dir | sed -e 's/^.*@//')
8-
dir="~/code/$dir"
14+
dir=$(echo $dir | sed -e 's/:/\//g')
15+
dir="$base_dir/$dir"
916

1017
git clone $@ $dir

0 commit comments

Comments
 (0)