From 0c896823a81ce253459176ea4c6aa8218fa10213 Mon Sep 17 00:00:00 2001 From: Shubho Banerjee Date: Tue, 15 Oct 2024 13:32:18 +0530 Subject: [PATCH] [JIRA: CDSADAPTERS-2150]fix for windows powershell issue --- lib/execute.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/execute.js b/lib/execute.js index e4df080..82f7467 100644 --- a/lib/execute.js +++ b/lib/execute.js @@ -1,5 +1,4 @@ const { spawn } = require('child_process'); -const path = require('path') const { parse_yaml } = require('./parse_yaml') const { font } = require('./constants') const readline = require('readline') @@ -27,9 +26,10 @@ async function ask(question) { async function execCommand(command, log = options.log) { if (!command) return const mainCommand = command[0] - const options = command.slice(1).flat() - const childProcess = spawn(mainCommand, options, { - cwd: process.cwd() + const args = command.slice(1).flat() + const childProcess = spawn(mainCommand, args, { + cwd: process.cwd(), + shell: true }) if (log) childProcess.stdout.on("data", (data) => process.stdout.write(data)); childProcess.stderr.on("data", (data) => process.stderr.write(data))