Files
tsumugu/frontend/mark-environment.mjs
T
LarsandCursor cbd45a8997
Deploy Development / deploy (push) Successful in 26s
Test Suite / pytest-backend (push) Successful in 1m35s
Test Suite / smoke-dev (push) Successful in 1s
Test Suite / frontend-build (push) Successful in 9s
Kennzeichne die Entwicklungsumgebung in der Oberflaeche, damit sie sich von Produktion unterscheiden laesst.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-17 22:25:45 +02:00

21 lines
880 B
JavaScript

import fs from "node:fs";
if (process.env.VITE_TSUMUGU_ENV !== "development") {
process.exit(0);
}
const manifestPath = new URL("./dist/manifest.webmanifest", import.meta.url);
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
manifest.name = "Tsumugu Entwicklung";
manifest.short_name = "Tsumugu Dev";
manifest.theme_color = "#8a5a12";
fs.writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`);
const indexPath = new URL("./dist/index.html", import.meta.url);
const html = fs
.readFileSync(indexPath, "utf8")
.replace("<title>Tsumugu</title>", "<title>Tsumugu · Entwicklung</title>")
.replace('name="apple-mobile-web-app-title" content="Tsumugu"', 'name="apple-mobile-web-app-title" content="Tsumugu Dev"')
.replace('name="theme-color" content="#085041"', 'name="theme-color" content="#8a5a12"');
fs.writeFileSync(indexPath, html);