From faa900d502bc4af505a08e01739b25455ab7b489 Mon Sep 17 00:00:00 2001 From: Madhur Tandon <20173739+madhur-tandon@users.noreply.github.com> Date: Tue, 2 Aug 2022 15:57:56 +0530 Subject: [PATCH] change args for Linux for sed (#651) --- pyscriptjs/Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pyscriptjs/Makefile b/pyscriptjs/Makefile index b5d9ce15..af96e95e 100644 --- a/pyscriptjs/Makefile +++ b/pyscriptjs/Makefile @@ -15,6 +15,12 @@ GOOD_NPM_VER := 6 NODE_VER := $(shell node -v | cut -d. -f1 | sed 's/^v\(.*\)/\1/') NPM_VER := $(shell npm -v | cut -d. -f1) +ifeq ($(shell uname -s), Darwin) + SED_I_ARG := -i '' +else + SED_I_ARG := -i +endif + GOOD_NODE := $(shell if [ $(NODE_VER) -ge $(GOOD_NODE_VER) ]; then echo true; else echo false; fi) GOOD_NPM := $(shell if [ $(NPM_VER) -ge $(GOOD_NPM_VER) ]; then echo true; else echo false; fi) @@ -55,9 +61,9 @@ examples: mkdir -p ./examples cp -r ../examples/* ./examples chmod -R 755 examples - find ./examples/toga -type f -name '*.html' -exec sed -i '' s+https://pyscript.net/alpha/+../../build/+g {} \; - find ./examples/webgl -type f -name '*.html' -exec sed -i '' s+https://pyscript.net/alpha/+../../../build/+g {} \; - find ./examples -type f -name '*.html' -exec sed -i '' s+https://pyscript.net/alpha/+../build/+g {} \; + find ./examples/toga -type f -name '*.html' -exec sed $(SED_I_ARG) s+https://pyscript.net/alpha/+../../build/+g {} \; + find ./examples/webgl -type f -name '*.html' -exec sed $(SED_I_ARG) s+https://pyscript.net/alpha/+../../../build/+g {} \; + find ./examples -type f -name '*.html' -exec sed $(SED_I_ARG) s+https://pyscript.net/alpha/+../build/+g {} \; test: make examples