From 477896601f6079c67468173f08c2a6dbad57a291 Mon Sep 17 00:00:00 2001 From: Haitao Yue Date: Fri, 31 Mar 2017 21:32:07 +0800 Subject: [PATCH] Fix sed command error in Mac OS Fix issue #CE-23 https://jira.hyperledger.org/browse/CE-23 Change-Id: I5d2ae66f0a6eed4e3a30ee06e5ff302cc9015d66 Signed-off-by: Haitao Yue --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 79fb4a13..8b67c237 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,12 @@ RESET := $(shell tput -Txterm sgr0) THEME?=basic STATIC_FOLDER?=themes\/${THEME}\/static TEMPLATE_FOLDER?=themes\/${THEME}\/templates +SYSTEM=$(shell uname) +ifeq ($(SYSTEM), Darwin) + SED = sed -ix +else + SED = sed -i +endif .PHONY: \ all \ @@ -40,8 +46,8 @@ redeploy: ##@Service Redeploy single service, Use like "make redeploy service=da bash scripts/redeploy.sh ${service} initial-env: ##@Configuration Initial Configuration for dashboard - sed -i 's/\(STATIC_FOLDER=\).*/\1${STATIC_FOLDER}/' .env - sed -i 's/\(TEMPLATE_FOLDER=\).*/\1${TEMPLATE_FOLDER}/' .env + $(SED) 's/\(STATIC_FOLDER=\).*/\1${STATIC_FOLDER}/' .env + $(SED) 's/\(TEMPLATE_FOLDER=\).*/\1${TEMPLATE_FOLDER}/' .env start: ##@Service Start service @$(MAKE) initial-env