mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
generate i18n on build
This commit is contained in:
@@ -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))
|
||||
Reference in New Issue
Block a user