Need to Consider the Case Senstive feature in CLI while creating new file.
Reason/Context
Please try answering a few of those questions
-
Why do we need this improvement? CLI should be case-sensitive while creating the file, currently, it is treating tutorial.yml and Tutorial.yml the same and enables to creation of files.
-
How will this change help? It will always be optimal to consider the case-sensitive feature in the CLI
Description
Please try answering a few of those questions
- Will this be a breaking change?
- No, it will not break any current changes only some validation added.
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
I think this is where the issues is https://github.com/asyncapi/cli/blob/2cc269700fdca55f65bd5ed0d63a1c2726d25011/src/commands/new/file.ts#L145
https://stackoverflow.com/questions/27367261/check-if-file-exists-case-sensitive https://forums.raspberrypi.com/viewtopic.php?t=119198
Thanks, @Souvikns Yes, here is the issue. that need to be changed, but, If we write the logic to create a new file after comparing the case as well, we cannot because OS doesn't allow to creation of two separate files with different cases.
Yeah, could we change the file-name that we get as input to lowercase and then create the file, or will it create inconvenience for the user?
@Souvikns We can do this when the user tries to create a file of the same name but different case it should get a message that a particular file is present with a different case. Please change the name. What's your thought?
@Souvikns We can do this when the user tries to create a file of the same name but different case it should get a message that a particular file is present with a different case. Please change the name. What's your thought?
@Souvikns @fmvilas Any thoughts on this?
@Souvikns We can do this when the user tries to create a file of the same name but different case it should get a message that a particular file is present with a different case. Please change the name. What's your thought?
🤔 actually the less warning from CLI the better the user experience, it would be better to handle this issue internally, and in our case, we can't really save two same file names with lower and uppercase because of how the filesystem works in nodejs. In my opinion, the error message we have right now works fine, and no need to change anything.
wasn't it solved?
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart:
🤔 actually the less warning from CLI the better the user experience, it would be better to handle this issue internally, and in our case, we can't really save two same file names with lower and uppercase because of how the filesystem works in nodejs. In my opinion, the error message we have right now works fine, and no need to change anything.
I agree with this approach 👍
@Souvikns Shouldn't we convert the input to lowercase as you proposed here?