cc4-embedded-system 3.1.2 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/gui.js +6 -1
  2. package/package.json +1 -1
package/dist/gui.js CHANGED
@@ -59,6 +59,7 @@
59
59
  */
60
60
  import express from 'express';
61
61
  import open from 'open';
62
+ import fs from 'node:fs';
62
63
  import path from 'node:path';
63
64
  import { fileURLToPath } from 'node:url';
64
65
  import { runMakeFsData } from './makefsdata.js';
@@ -85,7 +86,11 @@ if (portArgIndex !== -1 && process.argv[portArgIndex + 1]) {
85
86
  let server;
86
87
  let shutdownTimer = null;
87
88
  app.use(express.json());
88
- app.use(express.static(path.join(__dirname, '/public')));
89
+ const publicPath = fs.existsSync(path.join(__dirname, 'public'))
90
+ ? path.join(__dirname, 'public')
91
+ : path.join(__dirname, '../public');
92
+ console.log(`[System] Serving static files from: ${publicPath}`);
93
+ app.use(express.static(publicPath));
89
94
  const cancelShutdown = () => {
90
95
  if (shutdownTimer) {
91
96
  clearTimeout(shutdownTimer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc4-embedded-system",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "A modern typescript version of makefsdata based on html-minifier-next and lwIP v1.3.1",
5
5
  "bin": {
6
6
  "cc4es": "./dist/gui.js"