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

Lexiclean search directory so .. does not check the current directory #2236

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

casey
Copy link
Owner

@casey casey commented Jul 8, 2024

If the search directory was .., for example in the invocation just ../foo, we would wind up checking the justfile in the current directory since we did INVOCATION_DIRECTORY/...ancestors(), which would first return INVOCATION_DIRECTORY.

Instead, lexiclean the result of joining th invocation directory with the search directory, so .. is removed, and ancestors() doesn't return the invocation directory.

If the search directory was `..`, for example in the invocation
`just ../foo`, we would wind up checking the justfile in the current
directory since we did `INVOCATION_DIRECTORY/..`.ancestors(), which
would first return `INVOCATION_DIRECTORY`.

Instead, lexiclean the result of joining th invocation directory with
the search directory, so `..` is removed, and `ancestors()` doesn't
return the invocation directory.
@casey casey enabled auto-merge (squash) July 8, 2024 02:10
@casey casey merged commit 5648142 into master Jul 8, 2024
5 checks passed
@casey casey deleted the fix-search branch July 8, 2024 02:12
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.

1 participant