Skip to content

Commit ae85e04

Browse files
committed
Replace execSync() shell cmds w/ array args to avoid injection
Co-Authored-By: DeepSeek AI <[email protected]> ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/perplexity-omnibox]
1 parent 29c7892 commit ae85e04

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

utils/bump/extension-manifests.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
console.log(`Checking last commit details for ${platformManifestPath}...`)
4444
try {
4545
const latestCommitMsg = execSync(
46-
`git log -1 --format=%s -- "${platformManifestPath}"`, { encoding: 'utf8' }).trim()
46+
`git log -1 --format=%s -- "${path.relative(process.cwd(), path.dirname(manifestPath))}"`,
47+
{ encoding: 'utf8' }
48+
).trim()
4749
bump.log.hash(`${latestCommitMsg}\n`)
4850
if (/bump.*(?:ersion|manifest)/i.test(latestCommitMsg)) {
4951
console.log('No changes found. Skipping...\n') ; continue }
@@ -76,7 +78,7 @@
7678
// git add/commit/push
7779
try {
7880
execSync('git add ./**/manifest.json')
79-
execSync(`git commit -n -m "${commitMsg}"`)
81+
execSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
8082
if (!noPush) {
8183
bump.log.working('\nPulling latest changes from remote to sync local repository...\n')
8284
execSync('git pull')

0 commit comments

Comments
 (0)