From abdefbc0ff56ca548dfae290747c6573c543d8e6 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Wed, 14 Aug 2019 14:33:25 +0200 Subject: [PATCH] Use a custom variable to support test runs from IDE better When your IDE is running as an AppImage, the $APPRUN variable is already set in the built-in terminal. Now of course you could just calculate the path of $APPRUN yourself and force-overwrite it in that script; however that's more effort and more likely to break. Therefore it's easier to just introduce and use a custom variable. --- src/core/appdir_root_setup.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/appdir_root_setup.cpp b/src/core/appdir_root_setup.cpp index c0e8cee..6ababee 100644 --- a/src/core/appdir_root_setup.cpp +++ b/src/core/appdir_root_setup.cpp @@ -178,18 +178,18 @@ namespace linuxdeploy { << std::endl << "# autogenerated by linuxdeploy" << std::endl << std::endl - << "export APPDIR=${APPDIR:-$(readlink -f $(dirname \"$0\"))}" << std::endl + << "this_dir=$(readlink -f $(dirname \"$0\"))" << std::endl << std::endl; std::for_each(bf::directory_iterator(appRunHooksPath), bf::directory_iterator{}, [&oss](const bf::path& p) { if (!bf::is_regular_file(p)) return; - oss << "source \"$APPDIR\"/" << APPRUN_HOOKS_DIRNAME << "/" << p.filename(); + oss << "source \"$this_dir\"/" << APPRUN_HOOKS_DIRNAME << "/" << p.filename(); }); oss << std::endl - << "exec \"$APPDIR\"/AppRun.wrapped" << std::endl; + << "exec \"$this_dir\"/AppRun.wrapped" << std::endl; // first we need to make sure we're not running this more than once // this might cause more harm than good