Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Jpath handling #185

Merged
merged 1 commit into from
Nov 25, 2021
Merged

Conversation

malcolmholmes
Copy link
Collaborator

Ideally, we would have a way to track down the root of a project, and from there
identify where the default jsonnet paths of lib and vendor should be found.

In place of this, we need two forms:

  • Look in the directory of the jsonnet file. This has the benefit of allowing
    local overrides of other imports
  • Look in the current directory where Grizzly was invoked. This allows for
    running Grizzly in the midst of other larger jsonnet codebases.

Without this fix, the Grizzly/Jsonnet examples don't work.

Copy link
Collaborator

@dsotirakis dsotirakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one comment really.

absolutePaths = append(absolutePaths, path)
jsonnetDir := filepath.Dir(jsonnetFile)
for _, p := range jpath {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This for loop can be merged with the next one, by setting a temp := p var and then append both?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did think of that at first. But I want to have the two dirs relative to the jsonnet file first, then the two relative to the current directory.

@malcolmholmes malcolmholmes merged commit 0914220 into master Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants