Conversation
…cation Relative import source paths were previously resolved from the current working directory rather than the directory containing the config file, making it impossible to use relative imports in sub-configs. Additionally, executions in imported configs now default their working directory to the imported config file's directory. Any explicit relative working directory is also resolved against that location. This allows commands in sub-configs to reference sibling files (e.g. ./install.sh) without needing to know where they will be invoked from. Fixes #117
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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.
Summary
Fixes #117
source:paths inimportsare now resolved relative to the config file containing the import, not the current working directoryworkdir:values that are relative paths are resolved against the imported config file's directoryworkdir:values are left unchangedHow it works
parse_confignow accepts an optionalbase_dirderived from the config file's path. When an import is processed, its source path is resolved againstbase_dir. After loading the imported config,resolve_command_working_dirswalks all commands (and variables) recursively, setting each execution's working directory relative to the imported file's location. Inner imports set absolute paths during their own resolution pass, so the outer pass leaves them unchanged.A
normalize_pathhelper removes.and..components from joined paths without touching the filesystem, ensuring consistent path strings across assertions and comparisons.