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() {
|
bool ConfigurationApp::OnInit() {
|
||||||
initPrefixes();
|
initPrefixes();
|
||||||
|
makePaths();
|
||||||
|
|
||||||
|
|
||||||
// TODO: put config file creation here
|
// TODO: put config file creation here
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ int main (int argc, char** argv) {
|
||||||
std::cout << PROJECT_NAME " is starting..." << std::endl;
|
std::cout << PROJECT_NAME " is starting..." << std::endl;
|
||||||
|
|
||||||
initPrefixes();
|
initPrefixes();
|
||||||
|
makePaths();
|
||||||
|
|
||||||
// load config file and apply it
|
// load config file and apply it
|
||||||
configFileOpen(&optData);
|
configFileOpen(&optData);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <filesystem>
|
||||||
#include <paths.hpp>
|
#include <paths.hpp>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -30,6 +31,13 @@ void initPrefixes() {
|
||||||
#endif
|
#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 resolvePath(const char* path) {
|
||||||
std::string customString = prefixCustom + path;
|
std::string customString = prefixCustom + path;
|
||||||
std::string defaultString = prefixDefault + path;
|
std::string defaultString = prefixDefault + path;
|
||||||
|
|
|
@ -9,6 +9,8 @@ extern std::string prefixDefault;
|
||||||
|
|
||||||
void initPrefixes();
|
void initPrefixes();
|
||||||
|
|
||||||
|
void makePaths();
|
||||||
|
|
||||||
std::string resolvePath(const char* path);
|
std::string resolvePath(const char* path);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue