using executable path
aef1911 parent: 3f987ea modified
app/src/main.cpp +1 -2 | @@ -177,8 +177,7 @@ std::string getExecutablePath() { | ||
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | auto main(int argc, char const *argv[]) -> int { |
| 180 | - std::cout << getExecutablePath() << std::endl; | |
| 181 | - auto appPath{ std::filesystem::path(argv[0])}; | |
| 180 | + std::filesystem::path appPath{ getExecutablePath() }; | |
| 182 | 181 | auto databasePath{ std::filesystem::path(appPath.parent_path().string() + "/data.db")}; |
| 183 | 182 | bool newCreation = not std::filesystem::exists(databasePath.string()); |
| 184 | 183 | char *messageError; |
| @@ -177,8 +177,7 @@ std::string getExecutablePath() { | |||
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | auto main(int argc, char const *argv[]) -> int { | 179 | auto main(int argc, char const *argv[]) -> int { |
| 180 | - std::cout << getExecutablePath() << std::endl; | 180 | + std::filesystem::path appPath{ getExecutablePath() }; |
| 181 | - auto appPath{ std::filesystem::path(argv[0])}; | ||
| 182 | auto databasePath{ std::filesystem::path(appPath.parent_path().string() + "/data.db")}; | 181 | auto databasePath{ std::filesystem::path(appPath.parent_path().string() + "/data.db")}; |
| 183 | bool newCreation = not std::filesystem::exists(databasePath.string()); | 182 | bool newCreation = not std::filesystem::exists(databasePath.string()); |
| 184 | char *messageError; | 183 | char *messageError; |