Meta: Allow ladybird.sh to run any target in the MacOS app bundle

Previously, using `ladybird.sh run` with any target that was part of the
MacOS app bundle would try to run the given executable from the wrong
directory.
This commit is contained in:
Tim Ledbetter 2024-09-12 17:41:48 +01:00 committed by Andrew Kaster
parent 0bedc79ca5
commit b634683662
Notes: github-actions[bot] 2024-09-23 17:12:36 +00:00

View file

@ -208,7 +208,11 @@ build_and_run_lagom_target() {
local lagom_args=("${CMD_ARGS[@]:1}")
if [ -z "$lagom_target" ]; then
lagom_target="ladybird"
lagom_target="Ladybird"
fi
if [ "$lagom_target" = "ladybird" ]; then
lagom_target="Ladybird"
fi
# FIXME: Find some way to centralize these b/w CMakePresets.json, CI files, Documentation and here.
@ -219,14 +223,10 @@ build_and_run_lagom_target() {
build_target "${lagom_target}"
if [ "$lagom_target" = "ladybird" ] && [ "$(uname -s)" = "Darwin" ]; then
"$BUILD_DIR/bin/Ladybird.app/Contents/MacOS/Ladybird" "${lagom_args[@]}"
if [[ "$lagom_target" =~ ^(headless-browser|ImageDecoder|Ladybird|RequestServer|WebContent|WebDriver|WebWorker)$ ]] && [ "$(uname -s)" = "Darwin" ]; then
"$BUILD_DIR/bin/Ladybird.app/Contents/MacOS/$lagom_target" "${lagom_args[@]}"
else
local lagom_bin="$lagom_target"
if [ "$lagom_bin" = "ladybird" ]; then
lagom_bin="Ladybird"
fi
"$BUILD_DIR/bin/$lagom_bin" "${lagom_args[@]}"
"$BUILD_DIR/bin/$lagom_target" "${lagom_args[@]}"
fi
}