import os import asyncio SERVER_CSPROJ_DIR = "server" CLIENT_PACKAGE_DIR = "client" async def exec(cmd, path, silent=False): devnull = open(os.devnull, "wb") os.chdir(os.path.dirname(os.path.realpath(__file__))) os.chdir(os.pardir) os.chdir(path) proc = None if (not silent): print("Executing \"{0}\" in \"{1}\".".format(cmd, path)) proc = await asyncio.create_subprocess_shell(cmd) else: print("Executing \"{0}\" in \"{1}\" silently.".format(cmd, path)) proc = await asyncio.create_subprocess_shell(cmd, stdout=devnull) await proc.wait() devnull.close() async def main(): print("Beginning development servers.") await asyncio.gather( exec("dotnet watch run", SERVER_CSPROJ_DIR), exec("npm run serve", CLIENT_PACKAGE_DIR, silent=True)) asyncio.run(main())