-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBuild.py
More file actions
25 lines (19 loc) · 774 Bytes
/
Build.py
File metadata and controls
25 lines (19 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os
import subprocess
import shutil
output = subprocess.run('quasar build', shell=True, cwd='frontend')
# copy files from dist/spa to backend using python
# if static and templates folder exists, delete them
if os.path.exists('backend/static'):
shutil.rmtree('backend/static')
if os.path.exists('backend/templates'):
shutil.rmtree('backend/templates')
# create static and templates folder in backend
os.mkdir('backend/static')
os.mkdir('backend/templates')
shutil.move('frontend/dist/spa/index.html', 'backend/templates')
# move files inside dist.spa to backend/static
for file in os.listdir('frontend/dist/spa'):
shutil.move('frontend/dist/spa/' + file, 'backend/static')
# zip backend folder
shutil.make_archive('VmManager-build', 'zip', 'backend')