diff --git a/src/index.ts b/src/index.ts index f723638..6345e62 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import { execFile, execFileSync, ExecSyncOptions, ExecException } from "child_process"; +import { exec, execSync, ExecSyncOptions, ExecException } from "child_process"; import { existsSync } from "fs"; import createDebugger from "debug"; @@ -323,11 +323,9 @@ function gitlog( }; const execOptions = { cwd: userOptions.repo, ...userOptions.execOptions }; const command = createCommand(options); - - command = command.split(' '); if (!cb) { - const stdout = execFileSync(command[0], command.slice(1), execOptions).toString(); + const stdout = execSync(command, execOptions).toString(); const commits = stdout.split("@begin@"); if (commits[0] === "") { @@ -338,7 +336,7 @@ function gitlog( return parseCommits(commits, options.fields, options.nameStatus); } - execFile(command[0], command.slice(1), execOptions, (err, stdout, stderr) => { + exec(command, execOptions, (err, stdout, stderr) => { debug("stdout", stdout); const commits = stdout.split("@begin@");