瀏覽代碼

~/.bin/rt: Yeah, I've seen it so often, but welcome rt again!

rt - A stimpid (simple & stupid) repository tool

It's not there to keep you from learning your vcs tool inside out, but
to keep you from typing slightly different commands for actually the
same actions, but with different tools.
Lucas Stadler 14 年之前
父節點
當前提交
0a0647aeda
共有 1 個文件被更改,包括 25 次插入0 次删除
  1. 25 0
      .bin/rt

+ 25 - 0
.bin/rt

@ -0,0 +1,25 @@
1
#!/bin/bash
2
3
rt_REPO="$1"
4
5
if [ $# == 0 ]; then
6
	echo "Usage: $0 <repo-url>"
7
	echo -e " clones repository at <repo-url>"
8
	exit 1
9
fi
10
11
prog_from_url() {
12
	if [ `echo $1 | grep -E "(git|hub|repo.or.cz)"` ]; then
13
		rt_PROG="git"
14
	elif [ `echo $1 | grep -E "(hg|bitbucket)"` ]; then
15
		rt_PROG="hg"
16
	else
17
		echo "Error: Unknown repo at $1"
18
		exit 1
19
	fi
20
}
21
22
prog_from_url $rt_REPO
23
rt_CMD="clone"
24
25
$rt_PROG $rt_CMD $rt_REPO