Improve parsing of config paths#8
Open
oblivioncth wants to merge 2 commits intoFlashpointProject:mainfrom
Open
Improve parsing of config paths#8oblivioncth wants to merge 2 commits intoFlashpointProject:mainfrom
oblivioncth wants to merge 2 commits intoFlashpointProject:mainfrom
Conversation
Previously FPGS would try to append all other configuration paths to the root path, meaning that only the root path could be absolute, while the rest were forced to be relative. This change causes FPGS to clean, but not join, paths that are already absolute, so that absolute paths may be used in its configuration and on the command-line in addition to relative paths. Path manipulation is also simplified, as multiple redundant uses of `filepath.Abs()` + `path.Join()` were removed and replaced with `filepath.Join()` which handles standardizing path separators and otherwise cleaning paths to the same effect as the old method.
Uses the ServerSettings struct members as receivers for flag values directly instead of an intermediary variable, which cuts down on some of the boilerplate surrounding the loading of defaults via JSON and the processing of overrides via flags.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Partially streamlines the routines for loading default values, overriding them with command-line flags, and normalizing them.
Additionally allows for the use of absolute paths aside from the root path to be used without issue.