Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cpas6-install
Project
Project
Details
Activity
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
李金钢
cpas6-install
Commits
04333d74
Commit
04333d74
authored
Mar 19, 2026
by
Auto Backup
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Windows use cmd /c to execute commands for .cmd/.bat file support (like npm)
parent
2d79693e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
check-environment.js
check-environment.js
+6
-1
No files found.
check-environment.js
View file @
04333d74
...
@@ -143,6 +143,7 @@ function execWithShell(command, shellPath) {
...
@@ -143,6 +143,7 @@ function execWithShell(command, shellPath) {
async
function
executeCommand
(
command
)
{
async
function
executeCommand
(
command
)
{
try
{
try
{
let
parentShell
=
null
;
let
parentShell
=
null
;
let
actualCommand
=
command
;
if
(
isWindows
)
{
if
(
isWindows
)
{
try
{
try
{
...
@@ -153,9 +154,13 @@ async function executeCommand(command) {
...
@@ -153,9 +154,13 @@ async function executeCommand(command) {
}
catch
(
e
)
{
}
catch
(
e
)
{
// Ignore error, use default
// Ignore error, use default
}
}
// Windows: Wrap command with cmd /c to support .cmd and .bat files (like npm)
// pwsh cannot directly execute .cmd files
actualCommand
=
`cmd /c "
${
command
}
"`
;
}
}
const
result
=
await
execWithShell
(
c
ommand
,
parentShell
);
const
result
=
await
execWithShell
(
actualC
ommand
,
parentShell
);
return
{
success
:
true
,
stdout
:
result
.
stdout
,
stderr
:
result
.
stderr
};
return
{
success
:
true
,
stdout
:
result
.
stdout
,
stderr
:
result
.
stderr
};
}
catch
(
error
)
{
}
catch
(
error
)
{
return
{
return
{
...
...
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