From 5622e6ad65297e7c1866fe882b6175df4665c3ee Mon Sep 17 00:00:00 2001 From: rupareddy5 Date: Fri, 16 Dec 2022 11:26:59 +0530 Subject: [PATCH] fix(start): FuncBinary path with space in user home directories --- src/cli/commands/start.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/cli/commands/start.ts b/src/cli/commands/start.ts index 69e0be87..6d00802a 100644 --- a/src/cli/commands/start.ts +++ b/src/cli/commands/start.ts @@ -35,8 +35,16 @@ export default function registerCommand(program: Command) { .option("-a, --app-location ", "the folder containing the source code of the front-end application", DEFAULT_CONFIG.appLocation) .option("-i, --api-location ", "the folder containing the source code of the API application", DEFAULT_CONFIG.apiLocation) .option("-O, --output-location ", "the folder containing the built source of the front-end application", DEFAULT_CONFIG.outputLocation) - .option("-D, --app-devserver-url ", "connect to the app dev server at this URL instead of using output location", DEFAULT_CONFIG.appDevserverUrl) - .option("-is, --api-devserver-url ", "connect to the api server at this URL instead of using output location", DEFAULT_CONFIG.apiDevserverUrl) + .option( + "-D, --app-devserver-url ", + "connect to the app dev server at this URL instead of using output location", + DEFAULT_CONFIG.appDevserverUrl + ) + .option( + "-is, --api-devserver-url ", + "connect to the api server at this URL instead of using output location", + DEFAULT_CONFIG.apiDevserverUrl + ) .option("-j, --api-port ", "the API server port passed to `func start`", parsePort, DEFAULT_CONFIG.apiPort) .option("-q, --host ", "the host address to use for the CLI dev server", DEFAULT_CONFIG.host) .option("-p, --port ", "the port value to use for the CLI dev server", parsePort, DEFAULT_CONFIG.port) @@ -264,7 +272,7 @@ export async function start(options: SWACLIConfig) { // serve the api if and only if the user provides a folder via the --api-location flag if (isApiLocationExistsOnDisk) { - serveApiCommand = `cd "${userWorkflowConfig.apiLocation}" && ${funcBinary} start --cors "*" --port ${apiPort} ${funcArgs ?? ""}`; + serveApiCommand = `cd "${userWorkflowConfig.apiLocation}" && "${funcBinary}" start --cors "*" --port ${apiPort} ${funcArgs ?? ""}`; } } }