mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-02-04 08:09:08 +08:00
fix
This commit is contained in:
@@ -6,6 +6,7 @@ import { ProviderInterface } from '../provider-interface';
|
||||
import CloudRunnerSecret from '../../options/cloud-runner-secret';
|
||||
import { ProviderResource } from '../provider-resource';
|
||||
import { ProviderWorkflow } from '../provider-workflow';
|
||||
import { quote } from 'shell-quote';
|
||||
|
||||
class LocalCloudRunner implements ProviderInterface {
|
||||
listResources(): Promise<ProviderResource[]> {
|
||||
@@ -69,12 +70,12 @@ class LocalCloudRunner implements ProviderInterface {
|
||||
// On Windows, many built-in hooks use POSIX shell syntax. Execute via bash if available.
|
||||
if (process.platform === 'win32') {
|
||||
const inline = commands
|
||||
.replace(/"/g, '\\"')
|
||||
.replace(/\r/g, '')
|
||||
.split('\n')
|
||||
.filter((x) => x.trim().length > 0)
|
||||
.join(' ; ');
|
||||
const bashWrapped = `bash -lc "${inline}"`;
|
||||
// Use shell-quote to properly escape the command string, preventing command injection
|
||||
const bashWrapped = `bash -lc ${quote([inline])}`;
|
||||
return await CloudRunnerSystem.Run(bashWrapped);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user