From 0dcf694c8776ac03779e465bdc4859fba9be314d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 5 Jan 2014 16:47:12 +0100 Subject: More updater fixage Preserve --dir parameter after updating Allow more than one copy of a command line parameter in MultiMC Linux runner script no longer changes current directory, which allows '--dir .' Fixed unit tests, removed the obsolete one (for some legacy updater command line params that were also removed) [fixes 63127704] --- mmc_updater/src/UpdateInstaller.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mmc_updater/src/UpdateInstaller.cpp') diff --git a/mmc_updater/src/UpdateInstaller.cpp b/mmc_updater/src/UpdateInstaller.cpp index aca23ff7..b29c5316 100644 --- a/mmc_updater/src/UpdateInstaller.cpp +++ b/mmc_updater/src/UpdateInstaller.cpp @@ -46,6 +46,11 @@ void UpdateInstaller::setFinishCmd(const std::string& cmd) m_finishCmd = cmd; } +void UpdateInstaller::setFinishDir(const std::string &dir) +{ + m_finishDir = dir; +} + std::list UpdateInstaller::updaterArgs() const { std::list args; @@ -63,6 +68,11 @@ std::list UpdateInstaller::updaterArgs() const { args.push_back("--dry-run"); } + if (m_finishDir.size()) + { + args.push_back("--dir"); + args.push_back(m_finishDir); + } return args; } @@ -420,6 +430,11 @@ void UpdateInstaller::restartMainApp() if (!command.empty()) { + if(!m_finishDir.empty()) + { + args.push_back("--dir"); + args.push_back(m_finishDir); + } LOG(Info,"Starting main application " + command); if(!m_dryRun) { -- cgit v1.2.3