File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
+ import shutil
2
3
3
4
from sys import platform
4
5
from pydriller import Repository
5
6
6
- if platform == "win32" :
7
- copy_cmd = "copy"
8
- rm_dir_cmd = "rmdir /s /q"
9
- else :
10
- copy_cmd = "cp"
11
- rm_dir_cmd = "rm -rf"
12
7
13
8
speedtest_src_path = os .path .join ("examples" , "speedtest.py" )
14
9
speedtest_copy_path = os .path .join ("examples" , "speedtest2.py" )
15
- os . system ( f" { copy_cmd } { speedtest_src_path } { speedtest_copy_path } " ) # the file has to be outside of git
10
+ shutil . copyfile ( speedtest_src_path , speedtest_copy_path ) # the file has to be outside of git
16
11
17
12
commits = list (Repository ('.' , from_tag = "v0.6.0" ).traverse_commits ())
18
13
print ("Found commits:" )
24
19
name = commit .msg .replace ('\n ' , ' ' ).replace ('\r ' , ' ' )
25
20
print ("\n Processing" , commit .hash , name )
26
21
22
+ if os .path .exists ("build" ):
23
+ shutil .rmtree ("build" )
27
24
os .system (f"git checkout { commit .hash } " )
28
- os .system (f"{ rm_dir_cmd } build" )
29
25
print ("\n \n --------------------\n \n " )
30
26
ret = os .system ("python -m pip install ." )
31
27
print ("Install result:" , ret )
You can’t perform that action at this time.
0 commit comments