11#include " cortex_upd_cmd.h"
2+ #include < optional>
23#include " cli/commands/server_start_cmd.h"
34#include " server_stop_cmd.h"
45#include " utils/archive_utils.h"
@@ -27,16 +28,16 @@ std::chrono::seconds GetTimeSinceEpochMillisec() {
2728 return duration_cast<seconds>(system_clock::now ().time_since_epoch ());
2829}
2930
30- std::unique_ptr<system_info_utils::SystemInfo> GetSystemInfoWithUniversal () {
31+ /* std::unique_ptr<system_info_utils::SystemInfo> GetSystemInfoWithUniversal() {
3132 auto system_info = system_info_utils::GetSystemInfo();
3233 if (system_info->os == "mac") {
3334 CTL_INF("Change arch from " << system_info->arch << " to universal");
3435 system_info->arch = "universal";
3536 }
3637 return system_info;
37- }
38+ } */
3839
39- std::string GetNightlyInstallerName (const std::string& v,
40+ /* std::string GetNightlyInstallerName(const std::string& v,
4041 const std::string& os_arch) {
4142 const std::string kCortex = "cortex";
4243 // Remove 'v' in file name
@@ -66,7 +67,7 @@ std::string GetInstallCmd(const std::string& exe_path) {
6667 return "start /wait \"\" " + exe_path +
6768 " /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SkipPostInstall";
6869#endif
69- }
70+ } */
7071
7172std::string GetInstallCmdLinux (const std::string& script_path,
7273 const std::string& channel,
@@ -133,6 +134,7 @@ bool InstallNewVersion(const std::filesystem::path& dst,
133134
134135std::optional<std::string> CheckNewUpdate (
135136 std::optional<std::chrono::milliseconds> timeout) {
137+ (void ) timeout;
136138 // Get info from .cortexrc
137139 auto should_check_update = false ;
138140 auto config = file_manager_utils::GetCortexConfig ();
@@ -152,9 +154,10 @@ std::optional<std::string> CheckNewUpdate(
152154 }
153155
154156 auto url = url_parser::Url{
155- .protocol = " https" ,
156- .host = GetHostName (),
157- .pathParams = GetReleasePath (),
157+ /* .protocol = */ " https" ,
158+ /* .host = */ GetHostName (),
159+ /* .pathParams = */ GetReleasePath (),
160+ /* .queries = */ {},
158161 };
159162
160163 CTL_INF (" Engine release path: " << url.ToFullPath ());
@@ -264,9 +267,10 @@ bool CortexUpdCmd::GetStable(const std::string& v) {
264267 CTL_INF (" OS: " << system_info->os << " , Arch: " << system_info->arch );
265268
266269 auto url_obj = url_parser::Url{
267- .protocol = " https" ,
268- .host = GetHostName (),
269- .pathParams = GetReleasePath (),
270+ /* .protocol = */ " https" ,
271+ /* .host = */ GetHostName (),
272+ /* .pathParams = */ GetReleasePath (),
273+ /* .queries = */ {},
270274 };
271275 CTL_INF (" Engine release path: " << url_obj.ToFullPath ());
272276
@@ -318,9 +322,10 @@ bool CortexUpdCmd::GetBeta(const std::string& v) {
318322 CTL_INF (" OS: " << system_info->os << " , Arch: " << system_info->arch );
319323
320324 auto url_obj = url_parser::Url{
321- .protocol = " https" ,
322- .host = GetHostName (),
323- .pathParams = GetReleasePath (),
325+ /* .protocol = */ " https" ,
326+ /* .host = */ GetHostName (),
327+ /* .pathParams = */ GetReleasePath (),
328+ /* queries = */ {},
324329 };
325330 CTL_INF (" Engine release path: " << url_obj.ToFullPath ());
326331 auto res = curl_utils::SimpleGetJson (url_obj.ToFullPath ());
@@ -410,12 +415,16 @@ std::optional<std::string> CortexUpdCmd::HandleGithubRelease(
410415 return std::nullopt ;
411416 }
412417 auto download_task{DownloadTask{
413- .id = " cortex" ,
414- .type = DownloadType::Cortex,
415- .items = {DownloadItem{
416- .id = " cortex" ,
417- .downloadUrl = download_url,
418- .localPath = local_path,
418+ /* .id = */ " cortex" ,
419+ /* .status = */ DownloadTask::Status::Pending,
420+ /* .type = */ DownloadType::Cortex,
421+ /* .items = */ {DownloadItem{
422+ /* .id = */ " cortex" ,
423+ /* .downloadUrl = */ download_url,
424+ /* .localPath = */ local_path,
425+ /* .checksum = */ std::nullopt ,
426+ /* .bytes = */ std::nullopt ,
427+ /* .downloadedBytes = */ std::nullopt ,
419428 }},
420429 }};
421430
@@ -456,9 +465,10 @@ bool CortexUpdCmd::GetNightly(const std::string& v) {
456465 };
457466 std::vector<std::string> path_list (paths, std::end (paths));
458467 auto url_obj = url_parser::Url{
459- .protocol = " https" ,
460- .host = kNightlyHost ,
461- .pathParams = path_list,
468+ ./* protocol = */ " https" ,
469+ /* .host = */ kNightlyHost ,
470+ /* .pathParams = */ path_list,
471+ /* .queries = */ {},
462472 };
463473
464474 CTL_INF (" Cortex release path: " << url_parser::FromUrl (url_obj));
@@ -474,12 +484,16 @@ bool CortexUpdCmd::GetNightly(const std::string& v) {
474484 return false ;
475485 }
476486 auto download_task =
477- DownloadTask{.id = " cortex" ,
478- .type = DownloadType::Cortex,
479- .items = {DownloadItem{
480- .id = " cortex" ,
481- .downloadUrl = url_parser::FromUrl (url_obj),
482- .localPath = localPath,
487+ DownloadTask{/* .id = */ " cortex" ,
488+ /* .status = */ DownloadTask::Status::Pending,
489+ /* .type = */ DownloadType::Cortex,
490+ ./* items = */ {DownloadItem{
491+ /* .id = */ " cortex" ,
492+ /* .downloadUrl = */ url_parser::FromUrl (url_obj),
493+ /* .localPath = */ localPath,
494+ /* .checksum = */ std::nullopt ,
495+ /* .bytes = */ std::nullopt ,
496+ /* .downloadedBytes = */ std::nullopt ,
483497 }}};
484498
485499 auto result = download_service_->AddDownloadTask (
@@ -522,9 +536,10 @@ bool CortexUpdCmd::GetLinuxInstallScript(const std::string& v,
522536 " templates" , " linux" , " install.sh" };
523537 }
524538 auto url_obj = url_parser::Url{
525- .protocol = " https" ,
526- .host = " raw.githubusercontent.com" ,
527- .pathParams = path_list,
539+ /* .protocol = */ " https" ,
540+ /* .host = */ " raw.githubusercontent.com" ,
541+ /* .pathParams = */ path_list,
542+ /* .queries = */ {},
528543 };
529544
530545 CTL_INF (" Linux installer script path: " << url_parser::FromUrl (url_obj));
@@ -540,12 +555,16 @@ bool CortexUpdCmd::GetLinuxInstallScript(const std::string& v,
540555 return false ;
541556 }
542557 auto download_task =
543- DownloadTask{.id = " cortex" ,
544- .type = DownloadType::Cortex,
545- .items = {DownloadItem{
546- .id = " cortex" ,
547- .downloadUrl = url_parser::FromUrl (url_obj),
548- .localPath = localPath,
558+ DownloadTask{/* .id = */ " cortex" ,
559+ /* .status = */ DownloadTask::Status::Pending,
560+ /* .type = */ DownloadType::Cortex,
561+ /* .items = */ {DownloadItem{
562+ /* .id = */ " cortex" ,
563+ /* .downloadUrl = */ url_parser::FromUrl (url_obj),
564+ /* .localPath = */ localPath,
565+ /* .checksum = */ std::nullopt ,
566+ /* .bytes = */ std::nullopt ,
567+ /* .downloadedBytes = */ std::nullopt ,
549568 }}};
550569
551570 auto result = download_service_->AddDownloadTask (
0 commit comments