Skip to content

Commit 65241e5

Browse files
authored
Merge pull request #3 from Alinvor/developer
[DONE]合并分支
2 parents c43f22a + 8dae549 commit 65241e5

4 files changed

Lines changed: 171 additions & 1 deletion

File tree

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11

2+
# Generated files
23
bin/
4+
gen/
35
out/
4-
.DS_Store
6+
mock/
7+
venv/
8+
venv2/
9+
**/.DS_Store
510

11+
# vscode config files
12+
.vscode/settings.json
13+
14+
# script files
615
script/self/

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// 使用 IntelliSense 了解相关属性。
3+
// 悬停以查看现有属性的描述。
4+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
8+
{
9+
"type": "bashdb",
10+
"request": "launch",
11+
"name": "Bash-Debug",
12+
"program": "${file}"
13+
}
14+
]
15+
}

code.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
3+
echo "enter the directory(format is ../workspace/the_current_project, but you only input the_current_project or workspace/the_current_project): "
4+
read dir # input directory
5+
dir_name=$(dirname $dir)
6+
project_name=$(basename $dir)
7+
8+
function juageInteractionMode(){
9+
if [[ $1 == "\\" || $1 == "." ]];then
10+
return 1; # the relative path mode
11+
fi
12+
return 0; # the absolute path mode
13+
}
14+
15+
echo -n "enter the start date(format is xxxx-xx-xx): "
16+
read start_date # input start date
17+
18+
if [[ ! -d "./out" ]];then
19+
mkdir ./out
20+
fi
21+
22+
root_name="$(dirname $(dirname $(pwd)))" # the parent directory of the current workspace
23+
juageInteractionMode $dir_name
24+
mode=$? # 1: relative mode otherwise absolute mode
25+
project="" # the current project directory
26+
if [[ $mode == 1 ]];then
27+
project="${root_name}/$(basename $(dirname $(pwd)))/${project_name}"
28+
else
29+
project="${root_name}/${dir}"
30+
fi
31+
out_name="" # the current project statistics output directory.
32+
33+
if [[ ! -z $dir ]]; then
34+
if [[ ! -z $start_date ]]; then
35+
out_name="`pwd`/out/statistics_${project_name}_${start_date}_$(date "+%Y-%m-%d_%H%M%S")"
36+
mkdir -p $out_name
37+
echo -e "\n the current project directory:\n $project"
38+
echo -e "\n the current out directory:\n $out_name"
39+
echo -e "\n"
40+
python2 gitstats -c start_date=${start_date} ${project} ${out_name}
41+
else
42+
out_name="`pwd`/out/statistics_${project_name}_$(date "+%Y-%m-%d_%H%M%S")"
43+
mkdir -p $out_name
44+
echo -e "\n the current project directory:\n $project"
45+
echo -e "\n the current out directory:\n $out_name"
46+
echo -e "\n"
47+
python2 gitstats -c ${project} ${out_name}
48+
fi
49+
else
50+
echo "the current project directory: $project"
51+
echo "the current out directory: $out_name"
52+
echo "the directory is not vaild."
53+
fi
54+
exit 0
55+

readMe.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
2+
# gitstats
3+
4+
gitstats
5+
6+
7+
8+
## 构建`venv`环境
9+
10+
### venv2
11+
12+
```
13+
virtualenv -p /usr/local/bin/python2 --no-site-packages venv2
14+
```
15+
16+
## venv3
17+
18+
```
19+
virtualenv -p /usr/local/bin/python3 --no-site-packages venv
20+
```
21+
22+
## 使用方式
23+
24+
### 方式一
25+
26+
目录结构如下:
27+
28+
```
29+
+ root
30+
+ --- directory_work_space_xxx
31+
| + - directory_the_current_project
32+
|
33+
+ --- directory_work_space_gitstats
34+
+ - directory_the_gitstats_project //即 gitstats
35+
```
36+
37+
使用如下命令:
38+
```
39+
$ cd root/directory_work_space_gitstats/directory_the_gitstats_project(即gitstats)
40+
$ ./code.sh
41+
42+
$ enter the directory(format is ../workspace/the_current_project, but you only input the_current_project or workspace/the_current_pr
43+
oject):
44+
$ directory_work_space_xxx/directory_the_current_project
45+
46+
$ enter the start date(format is xxxx-xx-xx):
47+
$ enter the start date(format is xxxx-xx-xx): 2019-12-12
48+
49+
# the sensible browser
50+
# sensible-browser 'directory_work_space_gitstats/gitstats/out/statistics_directory_the_current_project_2019-xx-xx_2019-12-12_xxxxxx/index.html'
51+
```
52+
53+
### 方式二
54+
55+
目录结构如下:
56+
57+
```
58+
+ root
59+
+ --- directory_work_space_gitstats
60+
+ - directory_the_gitstats_project //即 gitstats
61+
+ - directory_the_current_project
62+
```
63+
64+
使用如下命令:
65+
```
66+
$ cd root/directory_work_space_gitstats/directory_the_gitstats_project(即gitstats)
67+
$ ./code.sh
68+
69+
$ enter the directory(format is ../workspace/the_current_project, but you only input the_current_project or workspace/the_current_pr
70+
oject):
71+
$ directory_the_current_project
72+
73+
$ enter the start date(format is xxxx-xx-xx):
74+
$ enter the start date(format is xxxx-xx-xx): 2019-12-12
75+
76+
# the sensible browser
77+
# sensible-browser 'directory_work_space_gitstats/gitstats/out/statistics_directory_the_current_project_2019-xx-xx_2019-12-12_xxxxxx/index.html'
78+
```
79+
## FAQ
80+
81+
### Note
82+
83+
> 其实就是注意一下,输入的目录:
84+
> 一种为: `directory_work_space_xxx/directory_the_current_project`
85+
> 一种为: `directory_the_current_project`
86+
>
87+
> 再然后就是注意一下,日期输入格式: `xxxx-xx-xx`
88+
> 举例: 2019-12-12
89+
>
90+
> 最后浏览器打开:
91+
> `../gitstats/out/statistics_directory_the_current_project_2019-xx-xx_2019-12-12_xxxxxx/index.html`

0 commit comments

Comments
 (0)