File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1919
2020import os
2121import shutil
22+ import logging
2223
2324from .fileset import FileSet
2425
@@ -36,14 +37,18 @@ def _remove_git_directory(self):
3637
3738 def download (self ):
3839 self ._remove_git_directory ()
39- cmd = "cd {0} && git clone --depth=1 {1} {2}" .format (
40+ cmd = "cd {0} && git clone --quiet -- depth=1 {1} {2}" .format (
4041 self .temp_dir , self .url , self .git_dir
4142 )
43+ logging .info (f"Git clone '{ self .url } '" )
4244 os .system (cmd )
4345
4446 # Move it to the root to avoid git default behavior to clone
4547 # into a subdirectory
46- cmd = "cd {0} && mv {1}/* . && rm -r -f {1}" .format (self .temp_dir , self .git_dir )
48+ cmd = "cd {0} && [ -d {1} ] && mv {1}/* {1}/.[!.]* {1}/..?* . 2>/dev/null && rm -rf {1}" .format (
49+ self .temp_dir , self .git_dir
50+ )
51+
4752 os .system (cmd )
4853
4954 def do (self ):
You can’t perform that action at this time.
0 commit comments