Skip to content

Commit

Permalink
Support specifying an OPENSCADPATH environment variable which will ha…
Browse files Browse the repository at this point in the history
…ve precedence over the hardcoded library paths. First step of issue #125
  • Loading branch information
kintel committed Oct 24, 2012
1 parent 5467bc9 commit ebf9ee0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/TODO.txt
Expand Up @@ -240,6 +240,7 @@ o Collect "all" available OpenSCAD scripts from the internets and run the integr
MISSING TESTS: MISSING TESTS:
-------------- --------------
o cmd-line -D variable override o cmd-line -D variable override
o OPENSCADPATH env.variable
o all functions o all functions
o mirror o mirror
o scale o scale
Expand Down
10 changes: 9 additions & 1 deletion src/parsersettings.cc
Expand Up @@ -28,7 +28,15 @@ std::string locate_file(const std::string &filename)


void parser_init(const std::string &applicationpath) void parser_init(const std::string &applicationpath)
{ {
// FIXME: Append paths from OPENSCADPATH before adding built-in paths // Add path from OPENSCADPATH before adding built-in paths
const char *openscadpath = getenv("OPENSCADPATH");
if (openscadpath) {
add_librarydir(boosty::absolute(fs::path(openscadpath)).string());
}

// FIXME: Support specifying more than one path in OPENSCADPATH
// FIXME: Add ~/.openscad/libraries
// FIXME: Add ~/Documents/OpenSCAD/libraries on Mac?


std::string librarydir; std::string librarydir;
fs::path libdir(applicationpath); fs::path libdir(applicationpath);
Expand Down

0 comments on commit ebf9ee0

Please sign in to comment.