Skip to content

Fix search of tools under $PATH #1236

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

Merged
merged 1 commit into from
Mar 11, 2025
Merged

Fix search of tools under $PATH #1236

merged 1 commit into from
Mar 11, 2025

Conversation

xexyl
Copy link
Contributor

@xexyl xexyl commented Mar 11, 2025

Due to the fact we have to have (for our tools) ./ ahead of other paths (including the tool names themselves) and also allow for a user to specify a path (even a bogus one, which if they do we will look for a proper path) and also search for installed paths, a more careful check has to be done in the find_utils() functions as otherwise it does not work when out of the repo directory.

Sync copyright fixes from jparse.

Due to the fact we have to have (for our tools) ./ ahead of other paths
(including the tool names themselves) and also allow for a user to specify a
path (even a bogus one, which if they do we will look for a proper path) and
also search for installed paths, a more careful check has to be done in the
find_utils() functions as otherwise it does not work when out of the repo
directory.

Sync copyright fixes from jparse.
@xexyl
Copy link
Contributor Author

xexyl commented Mar 11, 2025

Hopefully GitHub doesn't have any issues with this change either. If it does not then it's all good now I think. I actually saw the oddity in the debug output yesterday but as I was in the repo directory at the time it did not dawn on me as odd. The ordering issue has turned out to be a lot of fun, for funny definitions of fun.

@lcn2
Copy link
Contributor

lcn2 commented Mar 11, 2025

QUESTION

Do we need to perform the idea about looking for the source files (see GH-issuecomment-2715178275) as an additional safety check before simply executing tools out of "."?

@xexyl
Copy link
Contributor Author

xexyl commented Mar 11, 2025

QUESTION

Do we need to perform the idea about looking for the source files (see GH-issuecomment-2715178275) as an additional safety check before simply executing tools out of "."?

Nope. I replied in that comment how I did it. I just tested it again. However I can test it when it's not installed and out of the directory: though it should be fine - I'd have to give the options to the tools.

@xexyl
Copy link
Contributor Author

xexyl commented Mar 11, 2025

Just tested with it uninstalled: as expected it required the options.

See my comment there (replied to your comment a few minutes ago) where you can see out of the directory and also in the directory.

Copy link
Contributor

@lcn2 lcn2 left a comment

Choose a reason for hiding this comment

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

👍

@lcn2 lcn2 merged commit 58ba241 into ioccc-src:master Mar 11, 2025
3 checks passed
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.

2 participants