Skip to content

Commit

Permalink
idfk man
Browse files Browse the repository at this point in the history
  • Loading branch information
lsproule committed Nov 2, 2023
1 parent 2ad4b54 commit 66966e6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/Command/CommandDev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ namespace Command {

const std::string command = "cmake . && make && ./" + ctx->build_dir + "/" + ctx->project_name + " " + command_args;
#endif
system(command.c_str());
int success = system(command.c_str());
if (success != 0) {
std::cout << "Error running project" << std::endl;
}

// Call your recompilation command or any other action you want
},path);
Expand Down
6 changes: 5 additions & 1 deletion src/Command/CommandHelp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ namespace Command {
if ((static_cast<std::string>(std::getenv("TERM")) == "xterm-kitty")){
struct winsize w = {500, 500, 0, 0};
ioctl(0, TIOCGWINSZ, &w);
system("kitty +kitten icat --align left ~/Downloads/logo.png");
int success = system("kitty +kitten icat --align left ~/Downloads/logo.png");
if (success != 0) {
std::cout << "Error printing logo" << std::endl;
return false;
}
}

std::cout << "usage: "<< termcolor::green << "cmaker"<< termcolor::reset <<" <sub-command>" << ENDL
Expand Down
18 changes: 15 additions & 3 deletions src/Command/CommandRun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
namespace Command {
bool Interface::run(){
#ifdef DEBUG
system("mkdir -p build/build/");
system("cd build && cmake . && make && cd ..");
int success = system("mkdir -p build/build/");
if (success != 0) {
std::cout << "Error creating build directory" << std::endl;
return false;
}
success = system("cd build && cmake . && make && cd ..");
if (success != 0) {
std::cout << "Error building project" << std::endl;
return false;
}
#else
system("mkdir -p build");
system("cmake . ");
Expand All @@ -17,7 +25,11 @@ namespace Command {
file_name = "./build/build/";
#endif
std::string command = file_name + ctx->project_name;
system(command.c_str());
success = system(command.c_str());
if (success != 0) {
std::cout << "Error running project" << std::endl;
return false;
}
return true;
}
}
Expand Down

0 comments on commit 66966e6

Please sign in to comment.