@@ -3,6 +3,10 @@ SHELLCHECK ?= shellcheck
33PYTHON ?= python3
44CURL ?= curl
55BSDTAR ?= bsdtar
6+ TAR ?= tar
7+ ZIP ?= zip
8+ UNZIP ?= unzip
9+ GZIP ?= gzip
610MKDIRP ?= mkdir -p
711RMRF ?= rm -rf
812
@@ -12,6 +16,7 @@ TESTS = $(shell find test/ -type f -name '*.json')
1216
1317VERSION = $(shell tr -d '\n\r' < VERSION)
1418
19+ # TODO: Make `jsonschema fmt` automatically detect test files
1520all : common test
1621 $(JSONSCHEMA ) fmt schemas meta --verbose
1722 $(JSONSCHEMA ) fmt test --verbose --default-dialect " https://json-schema.org/draft/2020-12/schema"
@@ -25,6 +30,7 @@ common:
2530 $(SHELLCHECK ) scripts/* .sh
2631 ./scripts/schemas-tests-mirror.sh
2732
33+ # TODO: Make `jsonschema fmt` automatically detect test files
2834.PHONY : lint
2935lint : common
3036 $(JSONSCHEMA ) fmt schemas meta --verbose --check
@@ -41,9 +47,15 @@ include generate/iso/country/include.mk
4147external : $(EXTERNAL )
4248generate : $(GENERATE )
4349
50+ # TODO: Add a `jsonschema pkg` command instead
4451.PHONY : dist
4552dist :
4653 $(RMRF ) $@
4754 $(MKDIRP ) $@
48- $(BSDTAR ) -caf $@ /sourcemeta-std-v$(VERSION ) .zip -s ' |^schemas/||' --exclude ' .DS_Store' schemas/* LICENSE
49- $(BSDTAR ) -czf $@ /sourcemeta-std-v$(VERSION ) .tar.gz -s ' |^schemas/||' --exclude ' .DS_Store' schemas/* LICENSE
55+ cd schemas && $(ZIP ) -r ../$@ /sourcemeta-std-v$(VERSION ) .zip * -x ' *.DS_Store'
56+ $(ZIP ) $@ /sourcemeta-std-v$(VERSION ) .zip LICENSE
57+ $(UNZIP ) -l $@ /sourcemeta-std-v$(VERSION ) .zip
58+ cd schemas && $(TAR ) -cf ../$@ /sourcemeta-std-v$(VERSION ) .tar --exclude ' .DS_Store' *
59+ $(TAR ) -rf $@ /sourcemeta-std-v$(VERSION ) .tar LICENSE
60+ $(GZIP ) $@ /sourcemeta-std-v$(VERSION ) .tar
61+ $(TAR ) -tzf $@ /sourcemeta-std-v$(VERSION ) .tar.gz
0 commit comments