run_bepinex*.sh: self-relaunch improvements #692
Merged
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.
This targets master. v5-lts version: #693
Description
This modifies
run_bepinex*.shto support both old and new versions of Steam, as well as to support paths that contain spaces (which were supported in v5-lts but not in master).An additional, simple fix for a generic shell-script issue is also included.
Motivation and Context
Recently, Steam apparently changed the way it executes the game, inserting
--arguments where they didn’t exist before. So #562 and #563 modifiedrun_bepinex*.shto match this change by hardcoding the two added arguments. As noted in #562 (review), this presumably made it impossible to run BepInEx in older versions of Steam.This pull request teaches the code in
run_bepinex*.shto handle the--arguments in a special way, achieving the desired effect both in old Steam where they’re absent and in new Steam where they’re present.Further, the shell script now uses
execinstead ofcall; exit(thus allowing, for example, killed-by-signal status to be passed through to the invoker in case it matters, not to mention a minor efficiency improvement).How Has This Been Tested?
I’ve tested the new code in an isolated shell script (in openSUSE’s bash 4.4.23 and Ubuntu’s dash 0.5.11, both invoked as
sh), but I have not tested an actual Steam setup.Types of changes
Checklist: