Skip to content

Commit 189c02f

Browse files
committed
Replaced all multi-arg git execSync() w/ safer spawnSync()
1 parent 16b0e46 commit 189c02f

File tree

10 files changed

+51
-51
lines changed

10 files changed

+51
-51
lines changed

brave-omnibox/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/' }}
@@ -45,10 +45,10 @@
4545
if (!chromiumOnly && !ffOnly) {
4646
console.log(`Checking last commit details for ${platformManifestPath}...`)
4747
try {
48-
const latestCommitMsg = execSync(
49-
`git log -1 --format=%s -- "${path.relative(process.cwd(), path.dirname(manifestPath))}"`,
48+
const latestCommitMsg = spawnSync('git',
49+
['log', '-1', '--format=%s', '--', path.relative(process.cwd(), path.dirname(manifestPath))],
5050
{ encoding: 'utf8' }
51-
).trim()
51+
).stdout.trim()
5252
bump.log.hash(`${latestCommitMsg}\n`)
5353
if (/bump.*(?:ersion|manifest)/i.test(latestCommitMsg)) {
5454
console.log('No changes found. Skipping...\n') ; continue }
@@ -81,7 +81,7 @@
8181
// git add/commit/push
8282
try {
8383
execSync('git add ./**/manifest.json')
84-
execSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
84+
spawnSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
8585
if (!noPush) {
8686
bump.log.working('\nPulling latest changes from remote to sync local repository...\n')
8787
execSync('git pull')

chatgpt-auto-continue/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/' }}
@@ -45,10 +45,10 @@
4545
if (!chromiumOnly && !ffOnly) {
4646
console.log(`Checking last commit details for ${platformManifestPath}...`)
4747
try {
48-
const latestCommitMsg = execSync(
49-
`git log -1 --format=%s -- "${path.relative(process.cwd(), path.dirname(manifestPath))}"`,
48+
const latestCommitMsg = spawnSync('git',
49+
['log', '-1', '--format=%s', '--', path.relative(process.cwd(), path.dirname(manifestPath))],
5050
{ encoding: 'utf8' }
51-
).trim()
51+
).stdout.trim()
5252
bump.log.hash(`${latestCommitMsg}\n`)
5353
if (/bump.*(?:ersion|manifest)/i.test(latestCommitMsg)) {
5454
console.log('No changes found. Skipping...\n') ; continue }
@@ -81,7 +81,7 @@
8181
// git add/commit/push
8282
try {
8383
execSync('git add ./**/manifest.json')
84-
execSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
84+
spawnSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
8585
if (!noPush) {
8686
bump.log.working('\nPulling latest changes from remote to sync local repository...\n')
8787
execSync('git pull')

chatgpt-infinity/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/' }}
@@ -45,10 +45,10 @@
4545
if (!chromiumOnly && !ffOnly) {
4646
console.log(`Checking last commit details for ${platformManifestPath}...`)
4747
try {
48-
const latestCommitMsg = execSync(
49-
`git log -1 --format=%s -- "${path.relative(process.cwd(), path.dirname(manifestPath))}"`,
48+
const latestCommitMsg = spawnSync('git',
49+
['log', '-1', '--format=%s', '--', path.relative(process.cwd(), path.dirname(manifestPath))],
5050
{ encoding: 'utf8' }
51-
).trim()
51+
).stdout.trim()
5252
bump.log.hash(`${latestCommitMsg}\n`)
5353
if (/bump.*(?:ersion|manifest)/i.test(latestCommitMsg)) {
5454
console.log('No changes found. Skipping...\n') ; continue }
@@ -81,7 +81,7 @@
8181
// git add/commit/push
8282
try {
8383
execSync('git add ./**/manifest.json')
84-
execSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
84+
spawnSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
8585
if (!noPush) {
8686
bump.log.working('\nPulling latest changes from remote to sync local repository...\n')
8787
execSync('git pull')

chatgpt-omnibox/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/' }}
@@ -45,10 +45,10 @@
4545
if (!chromiumOnly && !ffOnly) {
4646
console.log(`Checking last commit details for ${platformManifestPath}...`)
4747
try {
48-
const latestCommitMsg = execSync(
49-
`git log -1 --format=%s -- "${path.relative(process.cwd(), path.dirname(manifestPath))}"`,
48+
const latestCommitMsg = spawnSync('git',
49+
['log', '-1', '--format=%s', '--', path.relative(process.cwd(), path.dirname(manifestPath))],
5050
{ encoding: 'utf8' }
51-
).trim()
51+
).stdout.trim()
5252
bump.log.hash(`${latestCommitMsg}\n`)
5353
if (/bump.*(?:ersion|manifest)/i.test(latestCommitMsg)) {
5454
console.log('No changes found. Skipping...\n') ; continue }
@@ -81,7 +81,7 @@
8181
// git add/commit/push
8282
try {
8383
execSync('git add ./**/manifest.json')
84-
execSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
84+
spawnSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
8585
if (!noPush) {
8686
bump.log.working('\nPulling latest changes from remote to sync local repository...\n')
8787
execSync('git pull')

chatgpt-widescreen/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/' }}
@@ -45,10 +45,10 @@
4545
if (!chromiumOnly && !ffOnly) {
4646
console.log(`Checking last commit details for ${platformManifestPath}...`)
4747
try {
48-
const latestCommitMsg = execSync(
49-
`git log -1 --format=%s -- "${path.relative(process.cwd(), path.dirname(manifestPath))}"`,
48+
const latestCommitMsg = spawnSync('git',
49+
['log', '-1', '--format=%s', '--', path.relative(process.cwd(), path.dirname(manifestPath))],
5050
{ encoding: 'utf8' }
51-
).trim()
51+
).stdout.trim()
5252
bump.log.hash(`${latestCommitMsg}\n`)
5353
if (/bump.*(?:ersion|manifest)/i.test(latestCommitMsg)) {
5454
console.log('No changes found. Skipping...\n') ; continue }
@@ -81,7 +81,7 @@
8181
// git add/commit/push
8282
try {
8383
execSync('git add ./**/manifest.json')
84-
execSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
84+
spawnSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
8585
if (!noPush) {
8686
bump.log.working('\nPulling latest changes from remote to sync local repository...\n')
8787
execSync('git pull')

deepseek-omnibox/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/' }}
@@ -45,10 +45,10 @@
4545
if (!chromiumOnly && !ffOnly) {
4646
console.log(`Checking last commit details for ${platformManifestPath}...`)
4747
try {
48-
const latestCommitMsg = execSync(
49-
`git log -1 --format=%s -- "${path.relative(process.cwd(), path.dirname(manifestPath))}"`,
48+
const latestCommitMsg = spawnSync('git',
49+
['log', '-1', '--format=%s', '--', path.relative(process.cwd(), path.dirname(manifestPath))],
5050
{ encoding: 'utf8' }
51-
).trim()
51+
).stdout.trim()
5252
bump.log.hash(`${latestCommitMsg}\n`)
5353
if (/bump.*(?:ersion|manifest)/i.test(latestCommitMsg)) {
5454
console.log('No changes found. Skipping...\n') ; continue }
@@ -81,7 +81,7 @@
8181
// git add/commit/push
8282
try {
8383
execSync('git add ./**/manifest.json')
84-
execSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
84+
spawnSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
8585
if (!noPush) {
8686
bump.log.working('\nPulling latest changes from remote to sync local repository...\n')
8787
execSync('git pull')

perplexity-omnibox/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')

phind-omnibox/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/' }}
@@ -45,10 +45,10 @@
4545
if (!chromiumOnly && !ffOnly) {
4646
console.log(`Checking last commit details for ${platformManifestPath}...`)
4747
try {
48-
const latestCommitMsg = execSync(
49-
`git log -1 --format=%s -- "${path.relative(process.cwd(), path.dirname(manifestPath))}"`,
48+
const latestCommitMsg = spawnSync('git',
49+
['log', '-1', '--format=%s', '--', path.relative(process.cwd(), path.dirname(manifestPath))],
5050
{ encoding: 'utf8' }
51-
).trim()
51+
).stdout.trim()
5252
bump.log.hash(`${latestCommitMsg}\n`)
5353
if (/bump.*(?:ersion|manifest)/i.test(latestCommitMsg)) {
5454
console.log('No changes found. Skipping...\n') ; continue }
@@ -81,7 +81,7 @@
8181
// git add/commit/push
8282
try {
8383
execSync('git add ./**/manifest.json')
84-
execSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
84+
spawnSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
8585
if (!noPush) {
8686
bump.log.working('\nPulling latest changes from remote to sync local repository...\n')
8787
execSync('git pull')

utils/bump/extension-manifests.js

Lines changed: 6 additions & 6 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 = { mode: process.argv.includes('--cache'), paths: { root: '.cache/' }}
@@ -60,10 +60,10 @@
6060
if (!chromiumOnly && !ffOnly) {
6161
console.log(`Checking last commit details for ${platformManifestPath}...`)
6262
try {
63-
const latestCommitMsg = execSync(
64-
`git log -1 --format=%s -- "${path.relative(process.cwd(), path.dirname(manifestPath))}"`,
65-
{ encoding: 'utf8', shell: true }
66-
).trim()
63+
const latestCommitMsg = spawnSync('git',
64+
['log', '-1', '--format=%s', '--', path.relative(process.cwd(), path.dirname(manifestPath))],
65+
{ encoding: 'utf8' }
66+
).stdout.trim()
6767
bump.log.hash(`${latestCommitMsg}\n`)
6868
if (/bump.*(?:ersion|manifest)/i.test(latestCommitMsg)) {
6969
console.log('No changes found. Skipping...\n') ; continue }
@@ -96,7 +96,7 @@
9696
// git add/commit/push
9797
try {
9898
execSync('git add ./**/manifest.json')
99-
execSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
99+
spawnSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
100100
if (!noPush) {
101101
bump.log.working('\nPulling latest changes from remote to sync local repository...\n')
102102
execSync('git pull')

you.com-omnibox/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/' }}
@@ -45,10 +45,10 @@
4545
if (!chromiumOnly && !ffOnly) {
4646
console.log(`Checking last commit details for ${platformManifestPath}...`)
4747
try {
48-
const latestCommitMsg = execSync(
49-
`git log -1 --format=%s -- "${path.relative(process.cwd(), path.dirname(manifestPath))}"`,
48+
const latestCommitMsg = spawnSync('git',
49+
['log', '-1', '--format=%s', '--', path.relative(process.cwd(), path.dirname(manifestPath))],
5050
{ encoding: 'utf8' }
51-
).trim()
51+
).stdout.trim()
5252
bump.log.hash(`${latestCommitMsg}\n`)
5353
if (/bump.*(?:ersion|manifest)/i.test(latestCommitMsg)) {
5454
console.log('No changes found. Skipping...\n') ; continue }
@@ -81,7 +81,7 @@
8181
// git add/commit/push
8282
try {
8383
execSync('git add ./**/manifest.json')
84-
execSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
84+
spawnSync('git', ['commit', '-n', '-m', commitMsg], { stdio: 'inherit', encoding: 'utf-8' })
8585
if (!noPush) {
8686
bump.log.working('\nPulling latest changes from remote to sync local repository...\n')
8787
execSync('git pull')

0 commit comments

Comments
 (0)