Closed xTrayambak closed 3 months ago
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
)
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.
Nevermind, I found an easy way to do this.
This PR adds the
nimble add
command, similar tocargo 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.