Преглед на файлове

Simplify `make dist` with multiple sed expressions

Totally forgot that this could be done.
Weiyi Lou преди 9 години
родител
ревизия
ed6700b2a2
променени са 1 файла, в които са добавени 3 реда и са изтрити 6 реда
  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|