Skip to content

Commit

Permalink
Make user data directory absolute on localhost build.
Browse files Browse the repository at this point in the history
This is to allow removing DRFs via the GUI, and also help prevent potential ambiguities.
  • Loading branch information
wcjohns committed Apr 25, 2024
1 parent 4e92b96 commit 33acf2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 13 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,19 @@ int main( int argc, char **argv )
return -25;
}

// We will make user data path absolute, so there wont be any ambiguity later on
// (I dont think we ever change CWD, but JIC)
if( !SpecUtils::is_absolute_path(dev_user_data) )
{
const std::string cwd = SpecUtils::get_working_path();
const std::string trial_dir = SpecUtils::append_path( cwd, dev_user_data );
if( SpecUtils::is_directory(trial_dir) )
{
dev_user_data = trial_dir;
SpecUtils::make_canonical_path( dev_user_data );
}
}//if( !SpecUtils::is_absolute_path(userDir) )

user_data_dir = dev_user_data;
#else
std::cerr << "You must specify the directory to store user data to (the 'userdatadir' option)."
Expand Down
1 change: 0 additions & 1 deletion src/InterSpec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8955,7 +8955,6 @@ void InterSpec::addToolsMenu( Wt::WWidget *parent )

m_relActManualMenuItem = popup->addMenuItem( "Isotopics from peaks" );
HelpSystem::attachToolTipOn( m_relActManualMenuItem,
"UNDER DEVELOPMENT."
" Uses the peaks you have fit to determine the relative activities of"
" nuclides. Does not require knowing the detector response or"
" shielding information." , showToolTips );
Expand Down

0 comments on commit 33acf2a

Please sign in to comment.