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

Fix tool init error message when target exists but not a dir #13869

Conversation

straight-shoota
Copy link
Member

@straight-shoota straight-shoota commented Oct 7, 2023

The current implementation using File.file? checks only if the lib directory is an ordinary file. But only directory is allowed. Other file types (special device, named pipe) are as invalid as an ordinary file.

This patch changes the check to succeed only if the path does not exists or is a directory.

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:tools:init labels Oct 7, 2023
@straight-shoota straight-shoota self-assigned this Oct 7, 2023
@straight-shoota straight-shoota added this to the 1.11.0 milestone Oct 7, 2023
@straight-shoota straight-shoota merged commit fc5a56a into crystal-lang:master Oct 17, 2023
@straight-shoota straight-shoota deleted the fix/tool-init-err-existing-dir branch October 17, 2023 09:12
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:tools:init
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants