| 425 | } |
| 426 | |
| 427 | void DisksApp::initializeHistoryFile() |
| 428 | { |
| 429 | String home_path; |
| 430 | const char * home_path_cstr = getenv("HOME"); // NOLINT(concurrency-mt-unsafe) |
| 431 | if (home_path_cstr) |
| 432 | home_path = home_path_cstr; |
| 433 | if (config().has("history-file")) |
| 434 | history_file = config().getString("history-file"); |
| 435 | else |
| 436 | history_file = home_path + "/.disks-file-history"; |
| 437 | |
| 438 | if (!history_file.empty() && !fs::exists(history_file)) |
| 439 | { |
| 440 | try |
| 441 | { |
| 442 | FS::createFile(history_file); |
| 443 | } |
| 444 | catch (const ErrnoException & e) |
| 445 | { |
| 446 | if (e.getErrno() != EEXIST) |
| 447 | throw; |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | history_max_entries = config().getUInt("history-max-entries", 1000000); |
| 452 | } |
| 453 | |
| 454 | void DisksApp::init(const std::vector<String> & common_arguments) |
| 455 | { |