Schleifen Chart von bis Kalendar

This commit is contained in:
Ismail Ali
2025-02-10 22:25:31 +01:00
parent 5f3f9bbe8d
commit 9242abae40
10 changed files with 350 additions and 230 deletions

View File

@@ -1,24 +1,24 @@
// /incrementVersion.ts
import fs from "fs";
import path from "path";
const fs = require("fs");
const path = require("path");
const filePath = path.join(__dirname, "../config/webVersion.ts");
const fileContent = fs.readFileSync(filePath, "utf8");
const versionFilePath = path.join(process.cwd(), "config/webVersion.ts");
const versionFile = fs.readFileSync(versionFilePath, "utf8");
const versionRegex = /const webVersion = "(\d+)\.(\d+)\.(\d+)\.(\d+)";/;
const match = fileContent.match(versionRegex);
// Regex, um Versionsnummer zu finden
const versionRegex = /(\d+)\.(\d+)\.(\d+)\.(\d+)/;
const match = versionFile.match(versionRegex);
if (!match) {
console.error("Version format not found!");
if (match) {
let [major, minor, patch, build] = match.slice(1).map(Number);
build++; // Erhöhe die Build-Nummer automatisch
const newVersion = `${major}.${minor}.${patch}.${build}`;
const updatedFile = versionFile.replace(versionRegex, newVersion);
fs.writeFileSync(versionFilePath, updatedFile, "utf8");
console.log(`✅ Webversion aktualisiert auf: ${newVersion}`);
} else {
console.error("❌ Konnte die Version nicht finden!");
process.exit(1);
}
const [_, major, minor, build, patch] = match;
const newVersion = `${major}.${minor}.${build}.${parseInt(patch, 10) + 1}`;
const updatedContent = fileContent.replace(
versionRegex,
`const webVersion = "${newVersion}";`
);
fs.writeFileSync(filePath, updatedContent, "utf8");
console.log(`Version updated to ${newVersion}`);