updated build system
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...

This commit is contained in:
2024-08-24 16:13:28 -05:00
parent 01f11884aa
commit ea3d69a2ee
9 changed files with 114 additions and 23 deletions

View File

@ -48,8 +48,6 @@ get_total_drive_space(const std::string &path) -> std::uint64_t;
is_modified_date_older_than(std::string_view path,
const std::chrono::hours &hours) -> bool;
[[nodiscard]] auto move_file(std::string from, std::string to) -> bool;
[[nodiscard]] auto
read_file_lines(const std::string &path) -> std::vector<std::string>;

View File

@ -248,24 +248,6 @@ auto is_modified_date_older_than(std::string_view path,
utils::time::get_time_now();
}
auto move_file(std::string from, std::string to) -> bool {
from = utils::path::absolute(from);
to = utils::path::absolute(to);
const auto directory = utils::path::get_parent_directory(to);
if (not utils::file::directory(directory).create_directory()) {
return false;
}
#if defined(_WIN32)
const bool ret = ::MoveFile(from.c_str(), to.c_str()) != 0;
#else
const bool ret = (rename(from.c_str(), to.c_str()) == 0);
#endif
return ret;
}
auto read_file_lines(const std::string &path) -> std::vector<std::string> {
std::vector<std::string> ret;
if (utils::file::file(path).exists()) {