2022-08-04 18:22:48 -05:00
|
|
|
//
|
|
|
|
// Created by quentin on 8/3/22.
|
|
|
|
//
|
|
|
|
|
2022-08-13 18:42:16 -05:00
|
|
|
#include "optHandlers/mainOptHandler.h"
|
2022-08-04 18:22:48 -05:00
|
|
|
|
2022-08-12 15:26:25 -05:00
|
|
|
#include <pwd.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string>
|
|
|
|
#include <filesystem>
|
2023-01-15 17:50:01 -06:00
|
|
|
|
2022-08-13 16:35:01 -05:00
|
|
|
|
|
|
|
using namespace Budget;
|
2022-08-12 15:26:25 -05:00
|
|
|
|
|
|
|
const std::string homeDirectory = getpwuid(getuid())->pw_dir;
|
2022-09-05 20:38:07 -05:00
|
|
|
const std::string configD = homeDirectory + "/.config/budget/";
|
|
|
|
const std::string storageD = homeDirectory + "/.local/share/budget/";
|
2022-08-12 15:26:25 -05:00
|
|
|
|
|
|
|
void createRequiredFolders() {
|
2022-09-05 20:38:07 -05:00
|
|
|
std::filesystem::create_directory(configD);
|
|
|
|
std::filesystem::create_directories(storageD);
|
|
|
|
std::filesystem::create_directories(storageD + "accounts");
|
|
|
|
std::filesystem::create_directories(storageD + "receipts");
|
2022-08-12 15:26:25 -05:00
|
|
|
}
|
|
|
|
|
2022-08-13 16:35:01 -05:00
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
std::vector<char *> args(argv, argv + argc);
|
2023-01-15 19:37:49 -06:00
|
|
|
OptHandlers::MainOptHandler moh(args);
|
2022-08-12 15:26:25 -05:00
|
|
|
return 0;
|
|
|
|
}
|