Pārlūkot izejas kodu

Log ESP Web Tools version (#328)

* Log ESP Web Tools version

* Prettier on generated code
Paulus Schoutsen 2 gadi atpakaļ
vecāks
revīzija
38e1398e0f

+ 4 - 0
.github/workflows/ci.yml

@@ -15,6 +15,10 @@ jobs:
 
     steps:
       - uses: actions/checkout@v3
+      - name: Install jq tool
+        run: |
+          sudo apt-get update
+          sudo apt-get install jq
       - name: Use Node.js
         uses: actions/setup-node@v3
         with:

+ 4 - 0
.github/workflows/npmpublish.yml

@@ -12,6 +12,10 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
+      - name: Install jq tool
+        run: |
+          sudo apt-get update
+          sudo apt-get install jq
       - uses: actions/setup-node@v3
         with:
           node-version: 16

+ 1 - 0
script/build

@@ -2,6 +2,7 @@
 set -e
 
 cd "$(dirname "$0")/.."
+echo 'export const version =' `jq .version package.json`";" > src/version.ts
 
 rm -rf dist
 NODE_ENV=production npm exec -- tsc

+ 5 - 0
src/install-dialog.ts

@@ -31,6 +31,11 @@ import { fireEvent } from "./util/fire-event";
 import { sleep } from "./util/sleep";
 import { downloadManifest } from "./util/manifest";
 import { dialogStyles } from "./styles";
+import { version } from "./version";
+
+console.log(
+  `ESP Web Tools ${version} by Nabu Casa; https://esphome.github.io/esp-web-tools/`
+);
 
 const ERROR_ICON = "⚠️";
 const OK_ICON = "🎉";

+ 1 - 0
src/version.ts

@@ -0,0 +1 @@
+export const version = "dev";