#!/bin/sh # A Dock launch has no project argument. Resolve everything from this bundle, # so the complete Builder folder can move without rewriting absolute paths. set -eu app_dir=$(cd -P -- "$(dirname -- "$0")" && pwd) install_dir=$(cd -P -- "$app_dir/../../.." && pwd) # The Builder keeps its records in the installation's builder folder # (installations from before that layout kept them in the folder itself). if [ -d "$install_dir/builder/installed" ]; then install_dir=$install_dir/builder; fi unset MAKEPAD_LOADER_EMAIL MAKEPAD_PACKAGE_DIR has_project=0 for arg in "$@"; do [ "$arg" != --cwd ] || has_project=1 done if [ "$has_project" = 0 ]; then project=$(cat "$install_dir/installed/@APP_BINARY@.project") case "$project" in /*) ;; *) project="$install_dir/$project" ;; esac set -- --cwd "$project" "$@" fi mkdir -p "$install_dir/target" exec "$app_dir/@APP_BINARY@-bin" "$@" >"$install_dir/target/@APP_BINARY@-app.log" 2>&1