Fixed a problem with the MUSRFITPATH-variable introduced recently for msr2data
This commit is contained in:
@ -502,13 +502,16 @@ int main(int argc, char *argv[])
|
||||
// and do the fitting
|
||||
if (!onlyInputCreation) {
|
||||
// check if MUSRFITPATH is set, if not issue a warning
|
||||
string path(getenv("MUSRFITPATH"));
|
||||
if (path.empty()) {
|
||||
cerr << endl << ">> msr2data: **WARNING** The MUSRFITPATH environment variable is not set!" << endl;
|
||||
cerr << endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << endl;
|
||||
} else {
|
||||
string path;
|
||||
try {
|
||||
path = boost::lexical_cast<string>(getenv("MUSRFITPATH"));
|
||||
path.append("/");
|
||||
}
|
||||
catch(boost::bad_lexical_cast &) {
|
||||
cerr << endl << ">> msr2data: **WARNING** The MUSRFITPATH environment variable is not set!";
|
||||
cerr << endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << endl;
|
||||
path = "";
|
||||
}
|
||||
ostringstream oss;
|
||||
oss << path << "musrfit" << " " << strInfile.str() << " " << musrfitOptions;
|
||||
cout << endl << ">> msr2data: **INFO** Calling " << oss.str() << endl;
|
||||
@ -582,13 +585,16 @@ int main(int argc, char *argv[])
|
||||
// and do the fitting
|
||||
if (!onlyInputCreation) {
|
||||
// check if MUSRFITPATH is set, if not issue a warning
|
||||
string path(getenv("MUSRFITPATH"));
|
||||
if (path.empty()) {
|
||||
cerr << endl << ">> msr2data: **WARNING** The MUSRFITPATH environment variable is not set!" << endl;
|
||||
cerr << endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << endl;
|
||||
} else {
|
||||
string path;
|
||||
try {
|
||||
path = boost::lexical_cast<string>(getenv("MUSRFITPATH"));
|
||||
path.append("/");
|
||||
}
|
||||
catch(boost::bad_lexical_cast &) {
|
||||
cerr << endl << ">> msr2data: **WARNING** The MUSRFITPATH environment variable is not set!";
|
||||
cerr << endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << endl;
|
||||
path = "";
|
||||
}
|
||||
ostringstream oss;
|
||||
oss << path << "musrfit" << " " << strInfile.str() << " " << musrfitOptions;
|
||||
cout << endl << ">> msr2data: **INFO** Calling " << oss.str() << endl;
|
||||
|
Reference in New Issue
Block a user