@@ -62,8 +62,10 @@ inline void CheckNewUpdate() {
6262 if (current_version != latest_version) {
6363 CLI_LOG (" \n A new release of cortex is available: "
6464 << current_version << " -> " << latest_version);
65- CLI_LOG (" To upgrade, run: cortex update" );
66- // CLI_LOG(json_res["html_url"].get<std::string>());
65+ CLI_LOG (" To upgrade, run: " << GetCortexBinary () << " update" );
66+ if (CORTEX_VARIANT == file_manager_utils::kProdVariant ) {
67+ CLI_LOG (json_res[" html_url" ].get <std::string>());
68+ }
6769 }
6870 } catch (const nlohmann::json::parse_error& e) {
6971 CTL_INF (" JSON parse error: " << e.what ());
@@ -83,7 +85,7 @@ inline bool ReplaceBinaryInflight(const std::filesystem::path& src,
8385 // Already has the newest
8486 return true ;
8587 }
86- std::filesystem::path temp = std::filesystem::temp_directory_path () / " cortex_temp" ;
88+ std::filesystem::path temp = dst. parent_path () / " cortex_temp" ;
8789
8890 try {
8991 if (std::filesystem::exists (temp)) {
@@ -97,8 +99,6 @@ inline bool ReplaceBinaryInflight(const std::filesystem::path& src,
9799 std::filesystem::perms::group_all |
98100 std::filesystem::perms::others_read |
99101 std::filesystem::perms::others_exec);
100- auto download_folder = src.parent_path ();
101- std::filesystem::remove_all (download_folder);
102102 } catch (const std::exception& e) {
103103 CTL_ERR (" Something wrong happened: " << e.what ());
104104 if (std::filesystem::exists (temp)) {
0 commit comments