Skip to content

Commit a8dd63d

Browse files
authored
chore: fix 'make cutarelease' to work with more recent npm (#86)
npm v10 behaviour for 'npm view [email protected] version' when that version does not exist has changed. It now exits non-zero and emits error info to stdout.
1 parent 5c73b79 commit a8dd63d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
SHELL=/bin/bash
12

23
# Some targets depend on https://github/trentm/json being on the PATH.
34
JSON ?= json
@@ -33,7 +34,7 @@ cutarelease: check
3334
@which $(JSON) 2>/dev/null 1>/dev/null && \
3435
ver=$(shell $(JSON) -f package.json version) && \
3536
name=$(shell $(JSON) -f package.json name) && \
36-
publishedVer=$(shell npm view -j $(shell $(JSON) -f package.json name)@$(shell $(JSON) -f package.json version) version 2>/dev/null) && \
37+
publishedVer=$(shell npm view -j $(shell $(JSON) -f package.json name) time 2>/dev/null | $(JSON) -D/ $(shell $(JSON) -f package.json version)) && \
3738
if [[ -n "$$publishedVer" ]]; then \
3839
echo "error: $$name@$$ver is already published to npm"; \
3940
exit 1; \

0 commit comments

Comments
 (0)