Create FG_HOME if not found
This commit is contained in:
parent
4f129a283b
commit
fb30e3609e
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue