Pārlūkot izejas kodu

Simplify `make dist` with multiple sed expressions

Totally forgot that this could be done.
Weiyi Lou 9 gadi atpakaļ
vecāks
revīzija
ed6700b2a2
1 mainītis faili ar 3 papildinājumiem un 6 dzēšanām
  1. 3 6
      Makefile

+ 3 - 6
Makefile

@@ -24,12 +24,9 @@ dist: ## Create a distribution for live usage.
 	  cat $$file >> dist/tags/app.tag; \
 	done
 	# --- Modify Index Page ---
-	@# Output is piped/redirected as BSD and GNU `sed -i` differ.
-	@cp index.html dist/temp.html
-	@sed "/$(JS_TAGS)/D" dist/temp.html | sed "s|$(APPJS_PH)|$(APPJS_TAG)|" > dist/index.html
-	@cp dist/index.html dist/temp.html
-	@sed "/$(RIOT_TAGS)/D" dist/temp.html | sed "s|$(APPTAG_PH)|$(APPTAG_TAG)|" > dist/index.html
-	@rm dist/temp.html
+	@sed -e "/$(JS_TAGS)/D" -e "s|$(APPJS_PH)|$(APPJS_TAG)|" \
+	     -e "/$(RIOT_TAGS)/D" -e "s|$(APPTAG_PH)|$(APPTAG_TAG)|" \
+	     index.html > dist/index.html
 	@echo "All Done!"
 
 CSS_FILES = s|@import.*[\'\"]\(.*\)[\'\"].*|\1|