apple has problem with <filesystem>, temporary disable it

This commit is contained in:
2022-03-08 17:47:21 +01:00
parent fc3a0dc230
commit 55ee694f6f

View File

@@ -4,11 +4,13 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <filesystem>
#include <iostream> #include <iostream>
// #include <filesystem>
std::vector<std::string> commands {}; std::vector<std::string> commands {};
// kryplove z applu a jejich problemy s filesystemem
/*
std::string get_history_file_dir() { std::string get_history_file_dir() {
std::string filename{".ml_history.txt"}; std::string filename{".ml_history.txt"};
const char *t = std::getenv("HOME"); const char *t = std::getenv("HOME");
@@ -16,6 +18,15 @@ std::string get_history_file_dir() {
if (t == nullptr) return std::filesystem::temp_directory_path() / filename; if (t == nullptr) return std::filesystem::temp_directory_path() / filename;
else return std::filesystem::path(std::string{t}) /filename; else return std::filesystem::path(std::string{t}) /filename;
} }
*/
std::string get_history_file_dir() {
std::string file{"/.ml_history.txt"};
const char *t = std::getenv("HOME");
if (t == nullptr) return "/tmp/" + file;
else return std::string{t} + "/" + file;
}
MlEnvironment * repl_env = nullptr; MlEnvironment * repl_env = nullptr;