- Externe Webservices von TALAS V5 integriert und geprüft (Statuscode + Antwortstruktur) - Eigene API-Endpunkte wie /api/talas_v5_DB/getDevices hinzugefügt und validiert - Prüfung von NEXT_PUBLIC_USE_MOCKS zur Vermeidung von Mockdaten in Produktion - Validierung der Umgebungsvariablen wie DB_HOST, DB_NAME und NODE_ENV ergänzt - Response-Status 200 bei vollständigem Erfolg, 207 bei Teilfehlern - Verbesserung der JSON-Antwortstruktur zur einfacheren Analyse
37 lines
1013 B
JavaScript
37 lines
1013 B
JavaScript
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
// Pfad zur appVersion.js
|
|
const versionFilePath = path.join(__dirname, "../config/appVersion.js");
|
|
|
|
// Datei einlesen
|
|
let content = fs.readFileSync(versionFilePath, "utf8");
|
|
|
|
// Version auslesen (wichtig: export const muss dabei sein wegen Next.js)
|
|
const versionRegex = /export const APP_VERSION = "(\d+)\.(\d+)\.(\d+)"/;
|
|
const match = content.match(versionRegex);
|
|
|
|
if (!match) {
|
|
console.error("Konnte Version nicht finden!");
|
|
process.exit(1);
|
|
}
|
|
|
|
let major = Number(match[1]);
|
|
let minor = Number(match[2]);
|
|
let patch = Number(match[3]);
|
|
|
|
// Patch erhöhen
|
|
patch++;
|
|
|
|
// Neue Version zusammenbauen
|
|
const newVersion = `${major}.${minor}.${patch}`;
|
|
|
|
// Dateiinhalt ersetzen
|
|
const newContent = content.replace(versionRegex, `export const APP_VERSION = "${newVersion}"`);
|
|
|
|
// Datei speichern
|
|
fs.writeFileSync(versionFilePath, newContent, "utf8");
|
|
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
|
console.log(`✅ Version erhöht auf: ${newVersion}`);
|
|
}
|