Skip to content

Commit

Permalink
update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yffbit committed May 29, 2024
1 parent 4e44daf commit c3e367b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ jobs:
# Runs a set of commands using the runners shell
- name: install dependencies
run: |
sudo apt install -y qt5-default qtbase5-dev qt5-qmake build-essential wget
sudo apt install -y qt5-default qtbase5-dev qt5-qmake build-essential wget cmake
# Runs a set of commands using the runners shell
- name: make appimage
run: |
ls
# ./build-AppImage.sh
ls
cmake --version
cmake -DCMAKE_BUILD_TYPE=Release -S . -B build
make -C build -j
Expand Down
2 changes: 1 addition & 1 deletion include/tools/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ string get_localtime();

class Logger {
public:
Logger(bool cmd, const char *path, const char *mode = "w", bool timestamp = false, bool new_line = true, int period = 10)
Logger(bool cmd, const char *path, const char *mode = "w+", bool timestamp = false, bool new_line = true, int period = 10)
:cmd(cmd), timestamp(timestamp), new_line(new_line), period(period) {
if(path) {
file = fopen(path, mode);
Expand Down
2 changes: 1 addition & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(this->ui->actionimport, &QAction::triggered, this, &MainWindow::on_actionimport_triggered);
connect(this->ui->actionexport, &QAction::triggered, this, &MainWindow::on_actionexport_triggered);
connect(this->ui->actionclear_all, &QAction::triggered, this, &MainWindow::on_actionclear_all_triggered);
logger = new QLogger((get_localtime() + ".txt").c_str(), "w", false, 1);
logger = new QLogger((get_localtime() + ".txt").c_str(), "w+", false, 1);
clt.logger = logger;
qSolverJob = new QSolverJob;
qSolverJob->clt = &clt;
Expand Down
2 changes: 1 addition & 1 deletion mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class QLogger : public Logger {
public:
QLogger(const char *path, const char *mode = "w", bool timestamp = false, int period = 10):Logger(false, path, mode, timestamp, true, period) {}
QLogger(const char *path, const char *mode = "w+", bool timestamp = false, int period = 10):Logger(false, path, mode, timestamp, true, period) {}
virtual void log(const char *format, ...) {
if(timestamp) log_time();
va_list args;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/CommandLineTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ int cmd_api(string &input_file, string &resource_dir, string &mode, string &log_
resource_dir = "./resources";
}
if(log_file.empty()) log_file = get_localtime() + ".txt";
Logger logger(true, log_file.c_str(), "w", true, true, 1);
Logger logger(true, log_file.c_str(), "w+", true, true, 1);
PokerMode poker_mode = PokerMode::UNKNOWN;
if(mode.empty() || mode == "holdem") poker_mode = PokerMode::HOLDEM;
else if(mode == "shortdeck") poker_mode = PokerMode::SHORTDECK;
Expand Down

0 comments on commit c3e367b

Please sign in to comment.