generate i18n on build

This commit is contained in:
Proddy
2022-11-05 12:54:28 +01:00
parent da911e374a
commit a3d3706b89
6 changed files with 4 additions and 2489 deletions

View File

@@ -20,16 +20,17 @@ def flagExists(flag):
def buildWeb():
os.chdir("interface")
print("Building interface with npm")
print("Building web interface...")
try:
env.Execute("npm install")
env.Execute("npx typesafe-i18n --no-watch")
env.Execute("npm run build")
buildPath = Path("build")
wwwPath = Path("../data/www")
if wwwPath.exists() and wwwPath.is_dir():
rmtree(wwwPath)
if not flagExists("PROGMEM_WWW"):
print("Copying interface to data directory")
print("Copying web files to data directory")
copytree(buildPath, wwwPath)
for currentpath, folders, files in os.walk(wwwPath):
for file in files:
@@ -40,4 +41,4 @@ def buildWeb():
if (len(BUILD_TARGETS) == 0 or "upload" in BUILD_TARGETS):
buildWeb()
else:
print("Skipping build interface step for target(s): " + ", ".join(BUILD_TARGETS))
print("Skipping build web interface for target(s): " + ", ".join(BUILD_TARGETS))