Skip to content

Commit 05ecb8e

Browse files
authored
tweak docs to clarify install depsOnly option (#1020)
* tweak docs to clarify install depsOnly option * tweak docs to clarify install options for local development * tweak docs to clarify install options for local development * tweak docs to clarify install options for local development
1 parent 9fd9c1b commit 05ecb8e

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

readme.markdown

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,17 +202,32 @@ version range, for example:
202202

203203
The latter command will install a version that is greater than ``0.5``.
204204

205-
If you don't specify a parameter and there is a ``package.nimble`` file in your
206-
current working directory then Nimble will install the package residing in
207-
the current working directory. This can be useful for developers who are locally
208-
testing their ``.nimble`` files before submitting them to the official package
209-
list. See the [Creating Packages](#creating-packages) section for more info on this.
210-
211205
Nim flags provided to `nimble install` will be forwarded to the compiler when
212206
building any binaries. Such compiler flags can be made persistent by using Nim
213207
[configuration](https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files)
214208
files.
215209

210+
#### Local Package Development
211+
212+
The ``install`` command can also be used for locally testing or developing a
213+
Nimble package by leaving out the package name parameter. Your current working
214+
directory must be a Nimble package and contain a valid ``package.nimble`` file.
215+
216+
Nimble will install the package residing in the current working directory when you
217+
don't specify a package name and the directory contains a ``package.nimble`` file.
218+
This can be useful for developers who are locally testing their ``.nimble`` files
219+
before submitting them to the official package list.
220+
See the [Creating Packages](#creating-packages) section for more info on this.
221+
222+
Dependencies required for developing or testing a project can be installed by
223+
passing `--depsOnly` without specifying a package name. Nimble will then install
224+
any missing dependencies listed in the package's ``package.nimble`` file in the
225+
current working directoy. Note that dependencies will be installed globally.
226+
227+
For example to install the dependencies for a Nimble project ``myPackage``:
228+
229+
$ cd myPackage/ && nimble install --depsOnly
230+
216231
#### Package URLs
217232

218233
A valid URL to a Git or Mercurial repository can also be specified, Nimble will

src/nimblepkg/options.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ Usage: nimble [nimbleopts] COMMAND [cmdopts]
106106
107107
Commands:
108108
install [pkgname, ...] Installs a list of packages.
109-
[-d, --depsOnly] Install only dependencies.
109+
[-d, --depsOnly] Only install dependencies. Leave out pkgname
110+
to install deps for a local nimble package.
110111
[-p, --passNim] Forward specified flag to compiler.
111112
[--noRebuild] Don't rebuild binaries if they're up-to-date.
112113
develop [pkgname, ...] Clones a list of packages for development.

0 commit comments

Comments
 (0)