git-watchtower 1.9.17 → 1.9.18

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.
@@ -2045,7 +2045,10 @@ function serveFile(res, filePath, logPath) {
2045
2045
  });
2046
2046
  }
2047
2047
 
2048
- const server = http.createServer((req, res) => {
2048
+ let server = null;
2049
+
2050
+ function createStaticServer() {
2051
+ return http.createServer((req, res) => {
2049
2052
  const url = new URL(req.url, `http://localhost:${PORT}`);
2050
2053
  let pathname = url.pathname;
2051
2054
  const logPath = pathname; // Keep original for logging
@@ -2084,7 +2087,8 @@ const server = http.createServer((req, res) => {
2084
2087
  }
2085
2088
 
2086
2089
  serveFile(res, filePath, logPath);
2087
- });
2090
+ });
2091
+ }
2088
2092
 
2089
2093
  // ============================================================================
2090
2094
  // File Watcher
@@ -2996,6 +3000,7 @@ async function start() {
2996
3000
  startServerProcess();
2997
3001
  } else {
2998
3002
  // Static mode
3003
+ server = createStaticServer();
2999
3004
  server.listen(PORT, () => {
3000
3005
  addLog(`Server started on http://localhost:${PORT}`, 'success');
3001
3006
  addLog(`Serving ${STATIC_DIR.replace(PROJECT_ROOT, '.')}`, 'info');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.9.17",
3
+ "version": "1.9.18",
4
4
  "description": "Terminal-based Git branch monitor with activity sparklines and optional dev server with live reload",
5
5
  "main": "bin/git-watchtower.js",
6
6
  "bin": {