-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew.cc
40 lines (25 loc) · 958 Bytes
/
new.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <filesystem>
#include <string_view>
#include <config.h>
#include <journal.h>
#include "common.h"
namespace fs = std::filesystem;
namespace app {
namespace commands {
auto create_target_binary( const std::string_view target_name ) {
}
auto create_target_library( const std::string_view target_name ) {
}
auto create_target( const std::string_view target_name ) {
auto curr_path = fs::current_path( );
if ( fs::exists( curr_path / DEFAULT_BUMP_FILE ) ) {
const auto src_path = curr_path / common::DEFAULT_SOURCE_DIR;
bool res = true;
res &= fs::create_directory( src_path / target_name );
return res;
}
LOG_ERROR( APP_TAG, "Can't create target. No '%1' in current directory", DEFAULT_BUMP_FILE );
return false;
}
} // namespace commands
} // namespace app