From a53aa34036e65f8c076042136f1d5ab7c23d2eff Mon Sep 17 00:00:00 2001 From: MoAlyousef Date: Sat, 12 Sep 2020 18:11:34 +0300 Subject: [PATCH] add arg clean --- src/args.cpp | 2 +- src/build.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/args.cpp b/src/args.cpp index a482eaf..39bd584 100644 --- a/src/args.cpp +++ b/src/args.cpp @@ -43,7 +43,7 @@ const char *handle_args(int argc, char **argv) { auto ret = build::clean(); if (ret) return "CMake clean error!"; - return "CMake run completed!"; + return "Cleaned build directory!"; } else { return "Unknown argument!"; } diff --git a/src/build.cpp b/src/build.cpp index a8aaa81..011d236 100644 --- a/src/build.cpp +++ b/src/build.cpp @@ -48,13 +48,13 @@ int run(int argc, char **argv) { } int clean() { - int ret = 0; + bool ret = false; cmake::CMake cmake(".", true); if (fs::exists(cmake.bin_dir)) { ret = fs::remove_all(cmake.bin_dir); fs::create_directory(cmake.bin_dir); } - return ret; + return !ret; } } // namespace cmkr::build