|
|
@ -17,6 +17,8 @@ using namespace std; |
|
|
|
using namespace fmt; |
|
|
|
using namespace fmt; |
|
|
|
namespace fs = std::filesystem; |
|
|
|
namespace fs = std::filesystem; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const auto ERROR = fmt::emphasis::bold | fg(fmt::color::red); |
|
|
|
|
|
|
|
|
|
|
|
#define BUF_MAX 1024 |
|
|
|
#define BUF_MAX 1024 |
|
|
|
|
|
|
|
|
|
|
|
class UpdateListener : public efsw::FileWatchListener { |
|
|
|
class UpdateListener : public efsw::FileWatchListener { |
|
|
@ -47,9 +49,11 @@ class UpdateListener : public efsw::FileWatchListener { |
|
|
|
dbc::check(rc == 0, "git ignored failed."); |
|
|
|
dbc::check(rc == 0, "git ignored failed."); |
|
|
|
|
|
|
|
|
|
|
|
if(!ignored) { |
|
|
|
if(!ignored) { |
|
|
|
println("filename={}, ignored={}", full_path.c_str(), ignored); |
|
|
|
println("\nCHANGE: filename={} .gitignored?={}", full_path.c_str(), ignored); |
|
|
|
|
|
|
|
|
|
|
|
changes = changes || !ignored; |
|
|
|
changes = changes || !ignored; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
print("."); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -69,6 +73,7 @@ void run_build(GameEngine &game, const char* command) { |
|
|
|
dbc::check(stats_out.good(), "Error opening stats.csv file."); |
|
|
|
dbc::check(stats_out.good(), "Error opening stats.csv file."); |
|
|
|
dbc::pre("simple test", [&]() { return stats_out.good(); }); |
|
|
|
dbc::pre("simple test", [&]() { return stats_out.good(); }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// need to catch the error message when the command is bad
|
|
|
|
FILE *build_out = popen(command, "r"); |
|
|
|
FILE *build_out = popen(command, "r"); |
|
|
|
dbc::check(build_out != nullptr, "Failed to run command."); |
|
|
|
dbc::check(build_out != nullptr, "Failed to run command."); |
|
|
|
|
|
|
|
|
|
|
@ -90,9 +95,14 @@ void run_build(GameEngine &game, const char* command) { |
|
|
|
lnumber, col, type, message); |
|
|
|
lnumber, col, type, message); |
|
|
|
|
|
|
|
|
|
|
|
stats_out << result; |
|
|
|
stats_out << result; |
|
|
|
println("{} @ {}:{}:{} {}", type, file_name, lnumber, col, message); |
|
|
|
print(ERROR, "\nHIT WITH {} @ {}:{}:{} {}", type, file_name, lnumber, col, message); |
|
|
|
|
|
|
|
|
|
|
|
game.hit(type); |
|
|
|
game.hit(type); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// refactor this
|
|
|
|
|
|
|
|
if(game.is_dead()) { |
|
|
|
|
|
|
|
print(ERROR, "YOU DIED!\n"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|