mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 20:35:54 +08:00
Clean-up build artifacts
Contributes to CURA-9157
This commit is contained in:
parent
6aa6786535
commit
a4e9a685ef
@ -63,6 +63,16 @@ def generate_wxs(source_path: Path, dist_path: Path, filename: Path, app_name: s
|
|||||||
except shutil.SameFileError:
|
except shutil.SameFileError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup_artifacts(dist_path: Path):
|
||||||
|
dist_loc = Path(os.getcwd(), dist_path)
|
||||||
|
dirt = [d for d in dist_loc.rglob("__pycache__") if d.is_dir()]
|
||||||
|
dirt += [d for d in dist_loc.rglob("*.dist-info") if d.is_dir()]
|
||||||
|
for d in dirt:
|
||||||
|
if d.exists():
|
||||||
|
shutil.rmtree(d, ignore_errors=True)
|
||||||
|
|
||||||
|
|
||||||
def build(dist_path: Path, filename: str):
|
def build(dist_path: Path, filename: str):
|
||||||
dist_loc = Path(os.getcwd(), dist_path)
|
dist_loc = Path(os.getcwd(), dist_path)
|
||||||
work_loc = work_path(filename)
|
work_loc = work_path(filename)
|
||||||
@ -97,4 +107,5 @@ if __name__ == "__main__":
|
|||||||
parser.add_argument("name", type=str, help="App name (e.g. 'UltiMaker Cura')")
|
parser.add_argument("name", type=str, help="App name (e.g. 'UltiMaker Cura')")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
generate_wxs(args.source_path, args.dist_path, args.filename, args.name)
|
generate_wxs(args.source_path, args.dist_path, args.filename, args.name)
|
||||||
|
cleanup_artifacts(args.dist_path)
|
||||||
build(args.dist_path, args.filename)
|
build(args.dist_path, args.filename)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user