Skip to content

Commit 2a111dc

Browse files
committed
Replaced all multi-arg git execSync() w/ safer spawnSync() ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/perplexity-omnibox]
1 parent 16c24ea commit 2a111dc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

utils/bump/extension-manifests.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// Import LIBS
1111
const fs = require('fs'),
1212
path = require('path'),
13-
{ execSync } = require('child_process')
13+
{ execSync, spawnSync } = require('child_process')
1414

1515
// Init CACHE vars
1616
const cache = { paths: { root: '.cache/' }}
@@ -42,10 +42,10 @@
4242
if (!chromiumOnly && !ffOnly) {
4343
console.log(`Checking last commit details for ${platformManifestPath}...`)
4444
try {
45-
const latestCommitMsg = execSync(
46-
`git log -1 --format=%s -- "${path.relative(process.cwd(), path.dirname(manifestPath))}"`,
45+
const latestCommitMsg = spawnSync('git',
46+
['log', '-1', '--format=%s', '--', path.relative(process.cwd(), path.dirname(manifestPath))],
4747
{ encoding: 'utf8' }
48-
).trim()
48+
).stdout.trim()
4949
bump.log.hash(`${latestCommitMsg}\n`)
5050
if (/bump.*(?:ersion|manifest)/i.test(latestCommitMsg)) {
5151
console.log('No changes found. Skipping...\n') ; continue }
@@ -78,7 +78,7 @@
7878
// git add/commit/push
7979
try {
8080
execSync('git add ./**/manifest.json')
81-
execSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
81+
spawnSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
8282
if (!noPush) {
8383
bump.log.working('\nPulling latest changes from remote to sync local repository...\n')
8484
execSync('git pull')

0 commit comments

Comments
 (0)