Explorar o código

improved readability of build.sh for pyinstaller

Rodja Trappe %!s(int64=2) %!d(string=hai) anos
pai
achega
f04b8b8297
Modificáronse 1 ficheiros con 8 adicións e 5 borrados
  1. 8 5
      website/reference.py

+ 8 - 5
website/reference.py

@@ -1059,11 +1059,14 @@ import subprocess
 from pathlib import Path
 import nicegui
 
-static_dir = Path(nicegui.__file__).parent
-parameters = '--onefile main.py --name "myapp" ' + \\
-    f'--add-data="{static_dir}{os.pathsep}nicegui"'
-
-subprocess.call('pyinstaller ' + parameters, shell=True)
+cmd = [
+    'pyinstaller',
+    'main.py', # your main file with ui.run()
+    '--name', 'myapp', # name of your app
+    '--onefile',
+    '--add-data', f'{Path(nicegui.__file__).parent}{os.pathsep}nicegui'       
+]
+subprocess.call(cmd)
         ```''')
 
         ui.markdown('''