aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNick Merwin <[email protected]>2021-06-28 17:56:13 -0700
committerNick Merwin <[email protected]>2021-06-28 17:56:13 -0700
commit565da5f354758903445db6cbee3bdba9ec697b9e (patch)
tree98ea59c85f25f4bd5f1c18c5427269fd38bb3274 /lib
parent79c97ba7bb601feac01b1a68af4781fd02b0ade4 (diff)
downloadnode-coveralls-master.tar.xz
node-coveralls-master.zip
swap exec for execFile in fetchGitDataHEAD3.1.1master
Credit: Adar Zandberg from the CxSCA AppSec team at Checkmarx. * devDependency updates from Dependabot alerts * bump version
Diffstat (limited to 'lib')
-rw-r--r--lib/fetchGitData.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/fetchGitData.js b/lib/fetchGitData.js
index ee69246..7674222 100644
--- a/lib/fetchGitData.js
+++ b/lib/fetchGitData.js
@@ -1,6 +1,6 @@
'use strict';
-const { exec } = require('child_process');
+const { execFile } = require('child_process');
require('./logger')();
function fetchGitData(git, cb) {
@@ -40,7 +40,7 @@ function fetchGitData(git, cb) {
}
//-- Use git?
- exec(`git rev-parse --verify ${git.head.id}`, err => {
+ execFile('git', ['rev-parse', '--verify', git.head.id], err => {
if (err) {
// git is not available...
git.head.author_name = git.head.author_name || 'Unknown Author';
@@ -56,7 +56,7 @@ function fetchGitData(git, cb) {
}
function fetchBranch(git, cb) {
- exec('git branch', (err, branches) => {
+ execFile('git', ['branch'], (err, branches) => {
if (err) {
return cb(err);
}
@@ -69,7 +69,7 @@ function fetchBranch(git, cb) {
const REGEX_COMMIT_DETAILS = /\nauthor (.+?) <([^>]*)>.+\ncommitter (.+?) <([^>]*)>.+[\S\s]*?\n\n(.*)/m;
function fetchHeadDetails(git, cb) {
- exec(`git cat-file -p ${git.head.id}`, (err, response) => {
+ execFile('git', ['cat-file', '-p', git.head.id], (err, response) => {
if (err) {
return cb(err);
}
@@ -89,7 +89,7 @@ function fetchHeadDetails(git, cb) {
}
function fetchRemotes(git, cb) {
- exec('git remote -v', (err, remotes) => {
+ execFile('git', ['remote', '-v'], (err, remotes) => {
if (err) {
return cb(err);
}