Skip to content

Commit

Permalink
fix: use nodejs instead of sed for parsing package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Dec 4, 2020
1 parent 7c7379d commit f58df9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions golang/cosmos/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME := $(shell sed -ne 's/.*"name": "\([^"]*\)".*/\1/p' package.json)
VERSION := $(shell sed -ne 's/.*"version": "\([^"]*\)".*/\1/p' package.json)
NAME := $(shell node -e 'console.log(require("./package.json").name)')
VERSION := $(shell node -e 'console.log(require("./package.json").version)')
COMMIT = $(shell hash=`git rev-parse --short HEAD 2>/dev/null`; if test -n "$$hash"; then echo $$hash`git diff --quiet || echo -dirty`; else cat git-revision.txt; fi)

default: all
Expand Down
8 changes: 7 additions & 1 deletion packages/deployment/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
REPOSITORY = agoric/cosmic-swingset
REPOSITORY_SDK = agoric/agoric-sdk
SS := ../cosmic-swingset/
TAG := $(shell test ! -f ../../package.json || sed -ne 's/.*"version": "\(.*\)".*/\1/p' ../../package.json)
VERSION := $(shell node -e 'console.log(require("../../package.json").version)' 2>/dev/null)

TAG := $(if $(VERSION),$(VERSION),latest)

# Don't push alpha tags as ":$(TAG)".
ifeq ($(TAG),latest)
DONT_PUSH_LATEST := :
else
DONT_PUSH_LATEST := $(if $(findstring -,$(TAG)),:,)
endif

docker-show-fat:
date > show-fat-bust-cache.stamp
Expand Down

0 comments on commit f58df9c

Please sign in to comment.