diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-07-21 13:50:37 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-07-21 13:50:37 +0300 |
commit | 3833165d851040d4eb27ca8d103ab1190058fa56 (patch) | |
tree | 4418ce94ad01280d4b1ab50d1225711e2262894a | |
parent | a9e4eac7b965450234c7a4fb2de1346a23ca67f2 (diff) |
[Export] Update generated CLI helper script to work on clean macOS Monterey installation.
-rw-r--r-- | platform/macos/export/export_plugin.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index 162a188f95..8cb69997d9 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -706,9 +706,20 @@ Error EditorExportPlatformMacOS::_export_debug_script(const Ref<EditorExportPres f->store_line("#!/bin/sh"); f->store_line("echo -ne '\\033c\\033]0;" + p_app_name + "\\a'"); - f->store_line("function realpath() { python -c \"import os,sys; print(os.path.realpath(sys.argv[1]))\" \"$0\"; }"); - f->store_line("base_path=\"$(dirname \"$(realpath \"$0\")\")\""); - f->store_line("\"$base_path/" + p_pkg_name + "\" \"$@\""); + f->store_line(""); + f->store_line("function app_realpath() {"); + f->store_line(" SOURCE=$1"); + f->store_line(" while [ -h \"$SOURCE\" ]; do"); + f->store_line(" DIR=$(dirname \"$SOURCE\")"); + f->store_line(" SOURCE=$(readlink \"$SOURCE\")"); + f->store_line(" [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE"); + f->store_line(" done"); + f->store_line(" echo \"$( cd -P \"$( dirname \"$SOURCE\" )\" >/dev/null 2>&1 && pwd )\""); + f->store_line("}"); + f->store_line(""); + f->store_line("BASE_PATH=\"$(app_realpath \"${BASH_SOURCE[0]}\")\""); + f->store_line("\"$BASE_PATH/" + p_pkg_name + "\" \"$@\""); + f->store_line(""); return OK; } |