mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
fix: handle escaped quotes in docker entrypoint parsing
This commit is contained in:
@@ -174,3 +174,27 @@ test('ConvertEntrypointComplex', function () {
|
||||
'entrypoint' => "sh -c 'npm install && npm start'",
|
||||
]);
|
||||
});
|
||||
|
||||
test('ConvertEntrypointWithEscapedDoubleQuotes', function () {
|
||||
$input = '--entrypoint "python -c \"print(\'hi\')\""';
|
||||
$output = convertDockerRunToCompose($input);
|
||||
expect($output)->toBe([
|
||||
'entrypoint' => "python -c \"print('hi')\"",
|
||||
]);
|
||||
});
|
||||
|
||||
test('ConvertEntrypointWithEscapedSingleQuotesInDoubleQuotes', function () {
|
||||
$input = '--entrypoint "sh -c \"echo \'hello\'\""';
|
||||
$output = convertDockerRunToCompose($input);
|
||||
expect($output)->toBe([
|
||||
'entrypoint' => "sh -c \"echo 'hello'\"",
|
||||
]);
|
||||
});
|
||||
|
||||
test('ConvertEntrypointSingleQuotedWithDoubleQuotesInside', function () {
|
||||
$input = '--entrypoint \'python -c "print(\"hi\")"\'';
|
||||
$output = convertDockerRunToCompose($input);
|
||||
expect($output)->toBe([
|
||||
'entrypoint' => 'python -c "print(\"hi\")"',
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user