aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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);
}