Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
M
macos-hub-skills
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郭阔
macos-hub-skills
Commits
7dfdb0e2
Commit
7dfdb0e2
authored
Aug 13, 2026
by
谢宇轩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: edit chromium args
parent
29d558a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
ensure-chromium.js
skills/news-harvester/scripts/ensure-chromium.js
+5
-1
ensure-chromium.js
skills/news-source-analyzer/scripts/ensure-chromium.js
+5
-1
No files found.
skills/news-harvester/scripts/ensure-chromium.js
View file @
7dfdb0e2
...
...
@@ -118,11 +118,15 @@ function macCandidates() {
function
linuxCandidates
()
{
// `command -v` resolves PATH-based binaries; fall back to common fixed paths.
// We invoke `sh -c 'command -v "$1"' sh <name>` rather than `execFileSync('command',
// [...], { shell: true })` because passing args together with shell:true triggers
// Node's DEP0190 deprecation (and is unsafe if `name` were ever user input). Here
// the name is passed positionally as $1, so it is never re-interpreted by the shell.
const
names
=
[
'chromium'
,
'chromium-browser'
,
'google-chrome'
,
'google-chrome-stable'
,
'brave-browser'
];
const
found
=
[];
for
(
const
n
of
names
)
{
try
{
const
p
=
execFileSync
(
'
command'
,
[
'-v'
,
n
],
{
stdio
:
[
'ignore'
,
'pipe'
,
'ignore'
],
shell
:
true
})
const
p
=
execFileSync
(
'
sh'
,
[
'-c'
,
'command -v "$1"'
,
'sh'
,
n
],
{
stdio
:
[
'ignore'
,
'pipe'
,
'ignore'
]
})
.
toString
().
trim
();
if
(
p
)
found
.
push
({
name
:
n
,
path
:
p
});
}
catch
(
e
)
{
/* not on PATH */
}
...
...
skills/news-source-analyzer/scripts/ensure-chromium.js
View file @
7dfdb0e2
...
...
@@ -118,11 +118,15 @@ function macCandidates() {
function
linuxCandidates
()
{
// `command -v` resolves PATH-based binaries; fall back to common fixed paths.
// We invoke `sh -c 'command -v "$1"' sh <name>` rather than `execFileSync('command',
// [...], { shell: true })` because passing args together with shell:true triggers
// Node's DEP0190 deprecation (and is unsafe if `name` were ever user input). Here
// the name is passed positionally as $1, so it is never re-interpreted by the shell.
const
names
=
[
'chromium'
,
'chromium-browser'
,
'google-chrome'
,
'google-chrome-stable'
,
'brave-browser'
];
const
found
=
[];
for
(
const
n
of
names
)
{
try
{
const
p
=
execFileSync
(
'
command'
,
[
'-v'
,
n
],
{
stdio
:
[
'ignore'
,
'pipe'
,
'ignore'
],
shell
:
true
})
const
p
=
execFileSync
(
'
sh'
,
[
'-c'
,
'command -v "$1"'
,
'sh'
,
n
],
{
stdio
:
[
'ignore'
,
'pipe'
,
'ignore'
]
})
.
toString
().
trim
();
if
(
p
)
found
.
push
({
name
:
n
,
path
:
p
});
}
catch
(
e
)
{
/* not on PATH */
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment