summaryrefslogtreecommitdiff
path: root/c++/environment.hpp
blob: 6b63f168ab3fa009968f4656c3202d322946acae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once

#include <forstio/error.hpp>
#include <filesystem>
#include <cstdlib>

namespace kel {
namespace lbm {

saw::error_or<std::filesystem::path> output_directory(){
	const char* home_dir = std::getenv("HOME");
	if(not home_dir){
		return saw::make_error<saw::err::not_found>("Couldn't find home dir");
	}

	return std::filesystem::path{home_dir} / ".lbm/";
}
}
}