Commandline: Add support for Non-Steam Games to getGameDir #971
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.
Yet another bit of work for #960.
This PR adds support for getting a Non-Steam Game's game folder. We do this by parsing the Exe out of the
shortcuts.vdf
file and using thedirname
of this as the EXE name. It was a little tricky integrating this into the existinggetGameDir
function, but I did it pretty cleanly, ignoring certain values or returning early if we still have to search on Non-Steam Games.Initially in #960 I thought about parsing out the
StartDir
, but I think using the Exe base dir makes more sense. They're usually the same, and if they aren't, the user modified that and can check it from Steam. I don't see a case where a user would need to know theStartDir
though, but I can imagine cases where they want to know where their Non-Steam Game was installed quickly from a command.This function is also compatible with the
only
option that can be passed to this function.In testing this works, but we need to make extra sure this doesn't break anything. After that though, a shellcheck and version bump will make this ready for merging.
This PR should complete the function integration work for Non-Steam Games, meaning the remaining work for #970 involves modifying
localconfig.vdf
using the functions added in #967, and the integration into thelist
command.These functions were integrated first because
list
may make use of these, so I wanted to integrate them first. They're also just useful to have integrated!