Make .local and .config directories on startup
Directories for the config file and custom data will be created when Facecam2D starts.
This commit is contained in:
parent
07ccce90d3
commit
b9c9cb3de4
|
@ -30,6 +30,8 @@ wxIMPLEMENT_APP(ConfigurationApp);
|
|||
|
||||
bool ConfigurationApp::OnInit() {
|
||||
initPrefixes();
|
||||
makePaths();
|
||||
|
||||
|
||||
// TODO: put config file creation here
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ int main (int argc, char** argv) {
|
|||
std::cout << PROJECT_NAME " is starting..." << std::endl;
|
||||
|
||||
initPrefixes();
|
||||
makePaths();
|
||||
|
||||
// load config file and apply it
|
||||
configFileOpen(&optData);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
#include <paths.hpp>
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -30,6 +31,13 @@ void initPrefixes() {
|
|||
#endif
|
||||
}
|
||||
|
||||
void makePaths() {
|
||||
std::filesystem::create_directories(prefixConfig);
|
||||
std::filesystem::create_directories(prefixCustom + "models/");
|
||||
std::filesystem::create_directories(prefixCustom + "cvdata/");
|
||||
}
|
||||
|
||||
|
||||
std::string resolvePath(const char* path) {
|
||||
std::string customString = prefixCustom + path;
|
||||
std::string defaultString = prefixDefault + path;
|
||||
|
|
|
@ -9,6 +9,8 @@ extern std::string prefixDefault;
|
|||
|
||||
void initPrefixes();
|
||||
|
||||
void makePaths();
|
||||
|
||||
std::string resolvePath(const char* path);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue