Skip to content

Commit 9a13012

Browse files
authored
[utils.ts] replace exec with execFile (#369)
1 parent d3fe3dd commit 9a13012

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/util/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

4-
import { execSync } from "child_process"
4+
import { execFileSync } from "child_process"
55
import * as fs from "fs"
66
import * as YAML from "js-yaml"
77
import * as jsonPointer from "json-pointer"
@@ -421,8 +421,8 @@ export function gitClone(url: string, directory: string) {
421421
}
422422

423423
try {
424-
const cmd = `git clone ${url} ${directory}`
425-
execSync(cmd, { encoding: "utf8" })
424+
const [file, args] = ["git", ["clone", url, directory]]
425+
execFileSync(file, args, { encoding: "utf8" })
426426
} catch (err) {
427427
throw new Error(`An error occurred while cloning git repository: ${util.inspect(err, { depth: null })}.`)
428428
}

0 commit comments

Comments
 (0)