-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultigource
More file actions
executable file
·36 lines (31 loc) · 957 Bytes
/
Copy pathmultigource
File metadata and controls
executable file
·36 lines (31 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# create gource from multiple repositories
# prepare
i=1
echo "" > multigource_data
# loop over directories (assuming they're git repos...)
while [ $i -le $# ]; do
# extract path from arguments
path=$(echo "$@" | cut -d ' ' -f $i)
# create log
gource --output-custom-log multigource_temp_data "$path"
# get repo name
while [ "$(echo "$path" | cut -s -d '/' -f 2-)" != "" ]; do
path=$(echo "$path" | cut -s -d '/' -f 2-)
done
if [ "$(echo "$path" | tail -c 2)" == "/" ]; then
path=$(echo "$path" | head -c -2)
fi
echo "$path"
# set repo name
re="s#(.+)\|#\1|/$path#"
sed -i -r "$re" multigource_temp_data
# add to data
cat multigource_temp_data >> multigource_data
i=$((i+1))
done
# combine/sort results and feed to gource
tail -n +2 < multigource_data | sort -n > multigource_temp_data
gource multigource_temp_data
rm multigource_data
rm multigource_temp_data