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 create directory behavior #983

Merged
merged 6 commits into from
Mar 27, 2022

Conversation

iacore
Copy link
Contributor

@iacore iacore commented Feb 3, 2022

Before this fix, nimble init will create a new directory if current directory name is a-b, because the inferred package name is a_b.

This fixed the behavior to align with what was in #503, so nimble init will never create a new directory.

Copy link
Collaborator

@dom96 dom96 left a comment

Choose a reason for hiding this comment

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

I think this needs some tests, any chance you could add some? :)

src/nimble.nim Outdated Show resolved Hide resolved
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
@iacore
Copy link
Contributor Author

iacore commented Feb 4, 2022

I don't know how to add tests to nimble. It would be something like this as shell script:

mkdir a-b
cd a-b
nimble init # then anwser all questions
test -e a_b.nimble # test file exist in pwd

@dom96
Copy link
Collaborator

dom96 commented Feb 8, 2022

Lots of examples in here https://github.com/nim-lang/nimble/tree/master/tests

Copy link
Collaborator

@dom96 dom96 left a comment

Choose a reason for hiding this comment

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

Thanks for the test! Once the CI passes this is good to go.

Comment on lines 10 to 11
let tempdir = installDir / "a-b"
createDir(tempdir)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you want to use getTempDir here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. How do I pass CI tests?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@iacore
Copy link
Contributor Author

iacore commented Mar 26, 2022

@dom96 not merged yet?

@narimiran narimiran merged commit d68b2cb into nim-lang:master Mar 27, 2022
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.

None yet

3 participants