Simplified some of TRestTools methods using <filesystem>
and avoid usage of env variables
#229
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before C++17 we had to do some complicated logic to work with paths, this is solved with the ` header, now present at REST.
Some methods to work with paths in REST relied on environment variables to work, such as
PWD
. This was causing some unexpected issues on my dev environment when thePWD
env variable doesn't match the current working directory.I have removed all apperances of environment variables when working on paths and I have rewritten the old methods to use
<filesystem>
. Now these methods are a single line and could probably be removed altogether so people start using the filesystem library, but they remain for now.I removed the method
TRestTools::ReturnToPreviousDirectory
as it relied on environment variables for state management and it was only used once in the whole code base. I replaced its usage in restG4.Related PR: