Board index FlightGear Development Nasal

FG can't find FG_HOME folder in command line...?

Nasal is the scripting language of FlightGear.

FG can't find FG_HOME folder in command line...?

Postby chriscalef » Thu Feb 21, 2019 8:35 pm

Just wondering what I'm missing here... I am making a custom Addon for FlightGear, and I can register it in the command line if I use a full path, like so:

./fgfs ... --addon=/home/chris/.fgfs/Addons/SimEarth


But I would rather use $FG_HOME in there, since that was what I thought it was for. When I do this:

./fgfs ... --addon=$FG_HOME/Addons/SimEarth


I get the following error

Error registering an add-on: unable to find add-on metadata file '//Addons/SimEarth/addon-metadata.xml'


Making it seem that $FG_HOME has no meaning in this context. Any insight on this?
chriscalef
 
Posts: 236
Joined: Wed Feb 20, 2013 9:28 pm

Re: FG can't find FG_HOME folder in command line...?

Postby Hooray » Thu Feb 21, 2019 8:40 pm

You cannot expect shell/variable expansion to work that way, you would have to specify the full path.
Apart from that, the kind of setup you have in mind is actually something that Florent (rominet) considered supporting out-of-the-box, i.e. a configurable API for "addon default locations" that would be traversed during startup, e.g. $FG_ROOT/Addons and $FG_HOME/Addons, I am not sure if any of this has materialized meanwhile or not, but a number of folks discussed the idea again on the devel list a couple of days ago - if in doubt I would file a feature request, so that we can gather feedback there.
If I remember correctly, not everbody seemed convinced that this would be a good idea.
However, it would be a very elegant way to ship certain add-ons as part of the release, while also allowing people to easily have pre-installed add-ons in a user-specific location
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: FG can't find FG_HOME folder in command line...?

Postby chriscalef » Thu Feb 21, 2019 8:48 pm

Ah, okay, I guess I'm just ahead of the curve then. ;-)

Thanks for the info.
chriscalef
 
Posts: 236
Joined: Wed Feb 20, 2013 9:28 pm


Return to Nasal

Who is online

Users browsing this forum: No registered users and 1 guest