1
0
Fork 0

Create FG_HOME if not found

This commit is contained in:
James Turner 2013-06-16 17:44:08 +01:00
parent 4f129a283b
commit fb30e3609e

View file

@ -432,12 +432,18 @@ void fgInitHome()
{ {
SGPath dataPath = SGPath::fromEnv("FG_HOME", platformDefaultDataPath()); SGPath dataPath = SGPath::fromEnv("FG_HOME", platformDefaultDataPath());
globals->set_fg_home(dataPath.c_str()); globals->set_fg_home(dataPath.c_str());
simgear::Dir fgHome(dataPath);
if (!fgHome.exists()) {
fgHome.create(0755);
}
} }
// Read in configuration (file and command line) // Read in configuration (file and command line)
bool fgInitConfig ( int argc, char **argv ) bool fgInitConfig ( int argc, char **argv )
{ {
SGPath dataPath = globals->get_fg_home(); SGPath dataPath = globals->get_fg_home();
simgear::Dir exportDir(simgear::Dir(dataPath).file("Export")); simgear::Dir exportDir(simgear::Dir(dataPath).file("Export"));
if (!exportDir.exists()) { if (!exportDir.exists()) {
exportDir.create(0777); exportDir.create(0777);