init project
This commit is contained in:
commit
821ea7eed0
16 changed files with 950 additions and 0 deletions
17
include/utils/local.hpp
Normal file
17
include/utils/local.hpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
#pragma once
|
||||
|
||||
#include <unistd.h>
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
|
||||
inline std::filesystem::path GetLocalPath() {
|
||||
const char* home_dir = getenv("HOME");
|
||||
if (home_dir == nullptr) {
|
||||
std::cerr << "Home directory was not declared" << std::endl;
|
||||
throw std::runtime_error("Was not found home directory");
|
||||
}
|
||||
std::filesystem::path result = std::filesystem::path(home_dir) / ".local/share/cl3";
|
||||
std::filesystem::create_directories(result);
|
||||
|
||||
return result;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue