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

Add nimble add command #1191

Merged
merged 6 commits into from
Mar 28, 2024
Merged

Add nimble add command #1191

merged 6 commits into from
Mar 28, 2024

Conversation

xTrayambak
Copy link
Contributor

This PR adds the nimble add command, similar to cargo add.
It verifies that the package does actually exist in the Nimble package index, unless it is a URL.
It also verifies that the package isn't already a dependency to the current working directory's Nimble file.

@arnetheduck
Copy link

arnetheduck commented Mar 11, 2024

Something this command should likely do is add a minimum version dependency on the current version of the package, ie if chronos 4.0 is available at the time of add, the added dependency should be chronos >= 4.0.0 (or possibly its semver equivalent, ie ~4.0)

@xTrayambak
Copy link
Contributor Author

xTrayambak commented Mar 12, 2024

Unfortunately ~/.nimble/packages_<xyz>.json's schema does not contain the current version, so we'll have to clone the package, install it, and then fetch the version. I'll look into that later. The problem is that it'll require us to modify the package install procs to return a string which contains the place where the package was cloned (generally in /tmp) and then read the Nimble file from there.

@xTrayambak
Copy link
Contributor Author

Nevermind, I found an easy way to do this.

@Araq Araq merged commit 83bd8fd into nim-lang:master Mar 28, 2024
3 checks passed
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.

3 participants