Skip to content

Commit 14e000c

Browse files
authored
fix(server): add shell=True to npm subprocess calls for Windows compatibility
fix(server): add shell=True to npm subprocess calls for Windows compatibility
1 parent 032ec16 commit 14e000c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ async def enable_cors(request, response):
142142

143143
async def start_vue_dev_server():
144144
await asyncio.create_subprocess_shell(
145-
"npm run dev", stdout=sys.stdout, stderr=sys.stderr, cwd=MAGMA_PATH
145+
"npm run dev", stdout=sys.stdout, stderr=sys.stderr, cwd=MAGMA_PATH, shell=True
146146
)
147147
logging.info("VueJS development server is live.")
148148

@@ -256,15 +256,15 @@ def list_str(values):
256256
if args.uiDevHost:
257257
if not os.path.exists(f"{MAGMA_PATH}/dist"):
258258
logging.info("Building VueJS front-end.")
259-
subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True)
259+
subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True, shell=True)
260260
logging.info("VueJS front-end build complete.")
261261
app_svc.application.on_response_prepare.append(enable_cors)
262262

263263
if args.build:
264264
if len(os.listdir(MAGMA_PATH)) > 0:
265265
logging.info("Building VueJS front-end.")
266-
subprocess.run(["npm", "install"], cwd=MAGMA_PATH, check=True)
267-
subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True)
266+
subprocess.run(["npm", "install"], cwd=MAGMA_PATH, check=True, shell=True)
267+
subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True, shell=True)
268268
logging.info("VueJS front-end build complete.")
269269
else:
270270
logging.warning(

0 commit comments

Comments
 (0)