mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-18 17:21:33 +00:00
feat: use execFile() to parse git commit
does not pointlessly spawn a new shell
This commit is contained in:
parent
82937b57db
commit
2b6fd37ba1
@ -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$/, ''))
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user