File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 help = "ripunzip executable rlocation" )
2828parser .add_argument ("--zip-manifest" , required = True ,
2929 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)" )
3032opts = parser .parse_args ()
3133
3234build_file = runfiles .Rlocation (opts .build_file )
3537zip_manifest = runfiles .Rlocation (opts .zip_manifest )
3638destdir = pathlib .Path (build_file ).resolve ().parent / opts .destdir
3739
38- if destdir .exists ():
40+ if destdir .exists () and opts . cleanup :
3941 shutil .rmtree (destdir )
4042
41- destdir .mkdir (parents = True )
43+ destdir .mkdir (parents = True , exist_ok = True )
4244subprocess .run ([script , "--destdir" , destdir ], check = True )
4345
4446with open (zip_manifest ) as manifest :
You can’t perform that action at this time.
0 commit comments