Don't try to move if there's no need to do so

This commit is contained in:
TheAssassin
2019-08-14 14:35:53 +02:00
parent abdefbc0ff
commit 72e4fb49e0

View File

@@ -197,6 +197,9 @@ namespace linuxdeploy {
// FIXME: try to find a way how to rewrap AppRun on subsequent runs or, even better, become idempotent
if (bf::exists(wrappedAppRunPath)) {
ldLog() << LD_WARNING << "Already found wrapped AppRun, using existing file/symlink" << std::endl;
} else {
// backup original AppRun
bf::rename(appRunPath, wrappedAppRunPath);
}
// in case the above check triggered a warning, it's possible that there is another AppRun in the AppDir
@@ -207,9 +210,6 @@ namespace linuxdeploy {
bf::remove(appRunPath);
}
// backup original AppRun
bf::rename(appRunPath, wrappedAppRunPath);
// install new script
std::ofstream ofs(appRunPath.string());