feat: use execFile() to parse git commit

does not pointlessly spawn a new shell
This commit is contained in:
Bobby 2022-08-21 22:16:24 +07:00
parent 82937b57db
commit 2b6fd37ba1
No known key found for this signature in database
GPG Key ID: 941839794CBF5A09

View File

@ -307,7 +307,7 @@ safe.use('/api', api)
// Git hash
if (config.showGitHash) {
utils.gitHash = await new Promise((resolve, reject) => {
require('child_process').exec('git rev-parse HEAD', (error, stdout) => {
require('child_process').execFile('git', ['rev-parse', 'HEAD'], (error, stdout) => {
if (error) return reject(error)
resolve(stdout.replace(/\n$/, ''))
})