diff --git a/Makefile b/Makefile index 80623092..1bb0d254 100644 --- a/Makefile +++ b/Makefile @@ -3,15 +3,14 @@ ifeq (${OS},Windows_NT) .SHELLFLAGS := -NoProfile -Command OS=windows HOST_ENV=${OS} - RM_RF=Remove-Item -ErrorAction Ignore -Recurse -Path else OS=$(shell uname | tr [:upper:] [:lower:]) HOST_ENV=${OS}-$(shell uname -m) - RM_RF=rm -rf endif DEVENV=devenv$(shell pwd | sed 's/\//-/g') DEVENV_IMAGE=nostalgia-devenv +RM_RF=python3 scripts/pybb rm ifndef VCPKG_DIR_BASE VCPKG_DIR_BASE=.vcpkg endif @@ -47,7 +46,9 @@ clean: $(foreach file, $(wildcard build/*), ${ENV_RUN} cmake --build $(file) --target clean;) .PHONY: purge purge: - ${ENV_RUN} ${RM_RF} build .current_build dist + ${ENV_RUN} ${RM_RF} .current_build + ${ENV_RUN} ${RM_RF} build + ${ENV_RUN} ${RM_RF} dist .PHONY: test test: build $(foreach file, $(wildcard build/*), ${ENV_RUN} cmake --build $(file) --target test;) diff --git a/scripts/pybb b/scripts/pybb new file mode 100644 index 00000000..853d24f6 --- /dev/null +++ b/scripts/pybb @@ -0,0 +1,18 @@ +#! /usr/bin/env python3 + +import os +import sys + +def mkdir(path): + if not os.path.exists(path) and os.path.isdir(path): + os.mkdir(path) + +def rm(path): + if os.path.exists(path) or os.path.islink(path): + os.remove(path) + +if sys.argv[1] == 'mkdir': + mkdir(sys.argv[2]) +elif sys.argv[1] == 'rm': + for i in range(2, len(sys.argv)): + rm(sys.argv[i])