Skip to content

Commit

Permalink
Add version check to make_header.sh (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
pzich authored Apr 18, 2024
1 parent 256cab0 commit 422ef35
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"xbuild": "vite build --emptyOutDir",
"build": "vite build --emptyOutDir && npm run deploy",
"serve": "vite preview",
"deploy": "bash -c '../../scripts/make_header.sh ../../_static/v2 server_index.h web_server'"
"deploy": "bash -c '../../scripts/make_header.sh ../../_static/v2 server_index_v2.h web_server 2'"
},
"dependencies": {
"http-proxy-middleware": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"xbuild": "vite build --emptyOutDir",
"build": "vite build --emptyOutDir && npm run deploy",
"serve": "vite preview",
"deploy": "bash -c '../../scripts/make_header.sh ../../_static/v3 server_index.h web_server'"
"deploy": "bash -c '../../scripts/make_header.sh ../../_static/v3 server_index_v3.h web_server 3'"
},
"dependencies": {
"chart.js": "^4.4.1",
Expand Down
2 changes: 2 additions & 0 deletions scripts/make_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
cat <<EOT >./$1/$2
#pragma once
// Generated from https://github.com/esphome/esphome-webserver
$(if [ -n "$4" ]; then echo "#if USE_WEBSERVER_VERSION == $4"; fi)
#include "esphome/core/hal.h"
namespace esphome {
Expand All @@ -14,4 +15,5 @@ cat <<EOT >>./$1/$2
} // namespace $3
} // namespace esphome
$(if [ -n "$4" ]; then echo "#endif"; fi)
EOT

0 comments on commit 422ef35

Please sign in to comment.