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.
This commit is contained in:
TheAssassin
2019-08-14 14:33:25 +02:00
parent 58845cee8f
commit abdefbc0ff

View File

@@ -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