From fb30e3609e9f317c74c223afaea4a141ee80cecf Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 16 Jun 2013 17:44:08 +0100 Subject: [PATCH] Create FG_HOME if not found --- src/Main/fg_init.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 436dd486d..e72e24e11 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -432,12 +432,18 @@ void fgInitHome() { SGPath dataPath = SGPath::fromEnv("FG_HOME", platformDefaultDataPath()); globals->set_fg_home(dataPath.c_str()); + + simgear::Dir fgHome(dataPath); + if (!fgHome.exists()) { + fgHome.create(0755); + } } // Read in configuration (file and command line) bool fgInitConfig ( int argc, char **argv ) { SGPath dataPath = globals->get_fg_home(); + simgear::Dir exportDir(simgear::Dir(dataPath).file("Export")); if (!exportDir.exists()) { exportDir.create(0777);