File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 27
27
help = "ripunzip executable rlocation" )
28
28
parser .add_argument ("--zip-manifest" , required = True ,
29
29
help = "The rlocation of a file containing newline-separated `prefix:zip_file` entries" )
30
+ parser .add_argument ("--cleanup" , action = argparse .BooleanOptionalAction , default = True ,
31
+ help = "Whether to wipe the destination directory before installing (true by default)" )
30
32
opts = parser .parse_args ()
31
33
32
34
build_file = runfiles .Rlocation (opts .build_file )
35
37
zip_manifest = runfiles .Rlocation (opts .zip_manifest )
36
38
destdir = pathlib .Path (build_file ).resolve ().parent / opts .destdir
37
39
38
- if destdir .exists ():
40
+ if destdir .exists () and opts . cleanup :
39
41
shutil .rmtree (destdir )
40
42
41
- destdir .mkdir (parents = True )
43
+ destdir .mkdir (parents = True , exist_ok = True )
42
44
subprocess .run ([script , "--destdir" , destdir ], check = True )
43
45
44
46
with open (zip_manifest ) as manifest :
You can’t perform that action at this time.
0 commit comments