From 90bcb79c352de819920785c1533fdbe77bdb24b4 Mon Sep 17 00:00:00 2001 From: vansangpfiev Date: Wed, 6 Nov 2024 16:56:44 +0700 Subject: [PATCH] fix: make cortex-nightly update -v works again (#1645) --- engine/cli/commands/cortex_upd_cmd.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/cli/commands/cortex_upd_cmd.cc b/engine/cli/commands/cortex_upd_cmd.cc index 61fc6076f..129b59405 100644 --- a/engine/cli/commands/cortex_upd_cmd.cc +++ b/engine/cli/commands/cortex_upd_cmd.cc @@ -42,7 +42,8 @@ std::unique_ptr GetSystemInfoWithUniversal() { std::string GetNightlyInstallerName(const std::string& v, const std::string& os_arch) { const std::string kCortex = "cortex"; - std::string version = v == "latest" ? "" : (v + "-"); + // Remove 'v' in file name + std::string version = v == "latest" ? "" : (v.substr(1) + "-"); #if defined(__APPLE__) && defined(__MACH__) return kCortex + "-" + version + os_arch + "-network-installer.pkg"; #elif defined(__linux__) @@ -55,7 +56,8 @@ std::string GetNightlyInstallerName(const std::string& v, // C:\Users\vansa\AppData\Local\Temp\cortex\cortex-windows-amd64-network-installer.exe std::string GetInstallCmd(const std::string& exe_path) { #if defined(__APPLE__) && defined(__MACH__) - return "sudo touch /var/tmp/cortex_installer_skip_postinstall && sudo installer " + return "sudo touch /var/tmp/cortex_installer_skip_postinstall && sudo " + "installer " "-pkg " + exe_path + " -target / && sudo rm /var/tmp/cortex_installer_skip_postinstall";