CircleCI-Public / circleci-cli

Use CircleCI from the command line
https://circleci-public.github.io/circleci-cli/
MIT License
405 stars 233 forks source link

CircleCI Orb Init Error Misleading #1018

Closed imlogang closed 7 months ago

imlogang commented 7 months ago

What problem does this feature solve?:

When running circleci orb init <directory> it will fail if the directory already exists, but it says that the repository already exists.

Provide an example:

$ circleci orb init <already_present_directory>
...
? Would you like to perform an automated setup of this orb? Yes, walk me through the process.
Downloading Orb Project Template into <already_present_directory>
A few questions to get you up and running.
...
? Enter the remote git repository <repository_link>

Thank you! Setting up your orb...

Error: repository already exists

It would be great if it could error out with Error: Directory already exists. I believe this logic exists here: https://github.com/CircleCI-Public/circleci-cli/blob/43878aa73c6d62396a228eccd138b5fdf4b8098e/cmd/orb.go#L1701-L1705

jvincent42 commented 7 months ago

The error comes from this call and means that a .git folder is already present in the folder of your orb. Deleting it should resolve the issue. The error wording is misleading in this case, I'll try to find a better one.

JulesFaucherre commented 7 months ago

This was addressed in this PR, should be released soon. Thanks for reporting!