Merge pull request #232 from Tormund/deps_only
Dependencies only installation
This commit is contained in:
commit
adb20af272
2 changed files with 11 additions and 1 deletions
|
|
@ -363,8 +363,15 @@ proc installFromDir(dir: string, latest: bool, options: Options,
|
|||
let realDir = pkgInfo.getRealDir()
|
||||
let binDir = options.getBinDir()
|
||||
let pkgsDir = options.getPkgsDir()
|
||||
var deps_options = options
|
||||
deps_options.depsOnly = false
|
||||
|
||||
# Dependencies need to be processed before the creation of the pkg dir.
|
||||
result.paths = processDeps(pkginfo, options)
|
||||
result.paths = processDeps(pkginfo, deps_options)
|
||||
|
||||
if options.depsOnly:
|
||||
result.pkg = pkgInfo
|
||||
return result
|
||||
|
||||
echo("Installing ", pkginfo.name, "-", pkginfo.version)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import nimblepkg/config, nimblepkg/version,
|
|||
type
|
||||
Options* = object
|
||||
forcePrompts*: ForcePrompt
|
||||
depsOnly*: bool
|
||||
queryVersions*: bool
|
||||
queryInstalled*: bool
|
||||
action*: Action
|
||||
|
|
@ -83,6 +84,7 @@ Options:
|
|||
--ver Query remote server for package version
|
||||
information when searching or listing packages
|
||||
--nimbleDir dirname Set the Nimble directory.
|
||||
-d --depsOnly Install only dependencies.
|
||||
|
||||
For more information read the Github readme:
|
||||
https://github.com/nim-lang/nimble#readme
|
||||
|
|
@ -254,6 +256,7 @@ proc parseFlag*(flag, val: string, result: var Options) =
|
|||
of "ver": result.queryVersions = true
|
||||
of "nimbledir": result.config.nimbleDir = val # overrides option from file
|
||||
of "installed", "i": result.queryInstalled = true
|
||||
of "depsOnly", "d": result.depsOnly = true
|
||||
else:
|
||||
raise newException(NimbleError, "Unknown option: --" & flag)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue