Skip to content

Commit

Permalink
fix: add todo
Browse files Browse the repository at this point in the history
  • Loading branch information
vansangpfiev committed Sep 5, 2024
1 parent 30185b9 commit c9ffefe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions engine/commands/cortex_upd_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const std::string kCortexBinary = "cortex-cpp";

CortexUpdCmd::CortexUpdCmd() {}

void CortexUpdCmd::Exec() {
void CortexUpdCmd::Exec(std::string v) {
// Check if the architecture and OS are supported
auto system_info = system_info_utils::GetSystemInfo();
if (system_info.arch == system_info_utils::kUnsupported ||
Expand All @@ -33,7 +33,8 @@ void CortexUpdCmd::Exec() {

// Download file
constexpr auto github_host = "https://api.github.com";
// std::string version = version_.empty() ? "latest" : version_;
// std::string version = v.empty() ? "latest" : std::move(v);
// TODO(sang): support download with version
std::string version = "latest";
std::ostringstream release_path;
release_path << "/repos/janhq/cortex.cpp/releases/" << version;
Expand Down
2 changes: 1 addition & 1 deletion engine/commands/cortex_upd_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace commands {
class CortexUpdCmd{
public:
CortexUpdCmd();
void Exec();
void Exec(std::string version);

private:
};
Expand Down
2 changes: 1 addition & 1 deletion engine/controllers/command_line_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ bool CommandLineParser::SetupCommand(int argc, char** argv) {
update_cmd->add_option("-v", cortex_version, "");
update_cmd->callback([&cortex_version, &check_update] {
commands::CortexUpdCmd cuc;
cuc.Exec();
cuc.Exec(cortex_version);
check_update = false;
});
}
Expand Down

0 comments on commit c9ffefe

Please sign in to comment.