mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 12:14:28 +00:00
fix: handle escaped quotes in docker entrypoint parsing
This commit is contained in:
1 parent
f89b86491b
commit
f5d549365c
2 files changed
+49
-12
No files matched your search
@@ -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