diff --git a/postbuild.py b/builder.py similarity index 93% rename from postbuild.py rename to builder.py index 6f6249c..d1a6e72 100755 --- a/postbuild.py +++ b/builder.py @@ -45,7 +45,7 @@ def mkPath(path): folder = os.path.join(folder, p) try: os.mkdir(folder) - except OSError as e: + except OSError: pass # Already exits, ignore @@ -73,7 +73,7 @@ def fixIndex(): with open(os.path.join(DIST, 'index.html'), 'r', encoding='utf8') as f: html = f.read() # include django headers - html = '{% load uds %}{% get_current_language as LANGUAGE_CODE %}' + html + html = '{% load uds i18n %}{% get_current_language as LANGUAGE_CODE %}' + html with open(os.path.join(os.path.join(UDS, TEMPLATE), 'index.html'), 'w', encoding='utf8') as f: f.write(translatePattern.sub(translations + jsdata, html)) @@ -122,8 +122,13 @@ def createDirs(): mkPath(os.path.join(UDS, STATIC)) mkPath(os.path.join(UDS, TEMPLATE)) +# +# def buildSource(): +# os.system('ng build --prod --output-hashing=none --aot --deleteOutputPath --build-optimizer --deploy-url /static/modern') def main(): + print('Use "yarn build" to correctly build for UDS') + # buildSource() createDirs() extractTranslations() fixIndex() diff --git a/package.json b/package.json index 17a5bfc..8ab2684 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "ng": "ng", "start": "ng serve --host 172.27.0.1 --port 9000 --proxy-config proxy.conf.json", "build": "ng build --prod --output-hashing=none --aot --deleteOutputPath --build-optimizer --deploy-url /static/modern", - "postbuild": "echo 'Hola'", + "postbuild": "python3 builder.py", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" diff --git a/src/app/navbar/navbar.component.html b/src/app/navbar/navbar.component.html index 9a013b8..15cfd56 100644 --- a/src/app/navbar/navbar.component.html +++ b/src/app/navbar/navbar.component.html @@ -16,7 +16,7 @@ diff --git a/src/index.html b/src/index.html index 96b4a5c..c86630e 100644 --- a/src/index.html +++ b/src/index.html @@ -12,14 +12,7 @@