Skip to content

Commit ae06a6b

Browse files
committed
fix(make): don't remove dir if we didn't make it
1 parent e8ed578 commit ae06a6b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,17 @@ bundlespec:
4545

4646
src/generated/service/index.ts: $(shell find api -type f)
4747
echo "Building service interface"
48-
$(eval BUNDLE_OUTPUT := $(shell mktemp -d))
48+
ifndef BUNDLE_OUTPUT
49+
$(eval BUNDLE_OUTPUT := $(shell mktemp -d))
50+
$(eval GENERATED_DIR := true)
51+
endif
4952
$(MAKE) bundlespec SERVICE_NAME=$(SERVICE_NAME) BUNDLE_OUTPUT=$(BUNDLE_OUTPUT)
5053
yarn dlx openapi-typescript-express $(BUNDLE_OUTPUT)/openapi-spec.json \
5154
--output ./src/generated/service/index.ts
5255
yarn prettier ./src/generated/service/index.ts --write
53-
rm -rf $(TMP)
56+
ifdef GENERATED_DIR
57+
rm -rf $(BUNDLE_OUTPUT)
58+
endif
5459

5560
# Config schema generation
5661
CONFIG_TYPE_SRC ?= src/types/config.ts

0 commit comments

Comments
 (0)