-
Notifications
You must be signed in to change notification settings - Fork 57
switch from AMPAS_DATA_PATH to RAWTOACES_DATA_PATH environment variable #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,7 @@ | |
| #include <string> | ||
| #include <algorithm> | ||
| #include <boost/filesystem.hpp> | ||
| #include <iostream> | ||
|
|
||
| #ifndef WIN32 | ||
| # include <sys/stat.h> | ||
|
|
@@ -343,10 +344,14 @@ inline vector<string> openDir( string path = "." ) | |
| { | ||
| vector<string> paths; | ||
|
|
||
| for ( auto &i: boost::filesystem::directory_iterator( path ) ) | ||
| if ( boost::filesystem::exists( path ) ) | ||
| { | ||
| if ( i.status().type() != boost::filesystem::file_type::directory_file ) | ||
| paths.push_back( i.path().string() ); | ||
| for ( auto &i: boost::filesystem::directory_iterator( path ) ) | ||
| { | ||
| if ( i.status().type() != | ||
| boost::filesystem::file_type::directory_file ) | ||
| paths.push_back( i.path().string() ); | ||
| } | ||
| } | ||
|
|
||
| return paths; | ||
|
|
@@ -448,7 +453,20 @@ inline dataPath &pathsFinder() | |
| const char *env; | ||
|
|
||
| vector<string> &PATHs = cdp.paths; | ||
| env = getenv( "AMPAS_DATA_PATH" ); | ||
|
|
||
| env = getenv( "RAWTOACES_DATA_PATH" ); | ||
| if ( !env ) | ||
| { | ||
| // Fallback to the old environment variable. | ||
| env = getenv( "AMPAS_DATA_PATH" ); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /nit random thought - maybe throw some warning message into console saying that this one is deprecated now and they should switch to a new one?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good idea. done! |
||
|
|
||
| if ( env ) | ||
| { | ||
| std::cerr << "Warning: The environment variable " | ||
| << "AMPAS_DATA_PATH is now deprecated. Please use " | ||
| << "RAWTOACES_DATA_PATH instead." << std::endl; | ||
| } | ||
| } | ||
|
|
||
| if ( env ) | ||
| path = env; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a place that describes what is expected structure of this folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, in the data repo readme