cli icon indicating copy to clipboard operation
cli copied to clipboard

Need to Consider the Case Senstive feature in CLI while creating new file.

Open AayushSaini101 opened this issue 2 years ago • 13 comments

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. image

  • 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.

AayushSaini101 avatar Sep 10 '23 09:09 AayushSaini101

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.

github-actions[bot] avatar Sep 10 '23 09:09 github-actions[bot]

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

Souvikns avatar Sep 11 '23 11:09 Souvikns

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.

AayushSaini101 avatar Sep 11 '23 11:09 AayushSaini101

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 avatar Sep 12 '23 09:09 Souvikns

@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?

AayushSaini101 avatar Sep 12 '23 11:09 AayushSaini101

@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?

AayushSaini101 avatar Sep 16 '23 06:09 AayushSaini101

@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.

Souvikns avatar Sep 18 '23 03:09 Souvikns

wasn't it solved?

derberg avatar Sep 25 '23 14:09 derberg

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:

github-actions[bot] avatar Jan 24 '24 00:01 github-actions[bot]

🤔 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?

peter-rr avatar Apr 16 '24 12:04 peter-rr