add install only dependencies
This commit is contained in:
parent
e29b915d9c
commit
cec74dbdcc
2 changed files with 90 additions and 82 deletions
|
|
@ -363,9 +363,13 @@ proc installFromDir(dir: string, latest: bool, options: Options,
|
||||||
let realDir = pkgInfo.getRealDir()
|
let realDir = pkgInfo.getRealDir()
|
||||||
let binDir = options.getBinDir()
|
let binDir = options.getBinDir()
|
||||||
let pkgsDir = options.getPkgsDir()
|
let pkgsDir = options.getPkgsDir()
|
||||||
# Dependencies need to be processed before the creation of the pkg dir.
|
var deps_options = options
|
||||||
result.paths = processDeps(pkginfo, options)
|
deps_options.depsOnly = false
|
||||||
|
|
||||||
|
# Dependencies need to be processed before the creation of the pkg dir.
|
||||||
|
result.paths = processDeps(pkginfo, deps_options)
|
||||||
|
|
||||||
|
if not options.depsOnly:
|
||||||
echo("Installing ", pkginfo.name, "-", pkginfo.version)
|
echo("Installing ", pkginfo.name, "-", pkginfo.version)
|
||||||
|
|
||||||
# Build before removing an existing package (if one exists). This way
|
# Build before removing an existing package (if one exists). This way
|
||||||
|
|
@ -453,11 +457,12 @@ proc installFromDir(dir: string, latest: bool, options: Options,
|
||||||
# processDeps).
|
# processDeps).
|
||||||
saveNimbleData(options)
|
saveNimbleData(options)
|
||||||
|
|
||||||
|
echo(pkgInfo.name & " installed successfully.")
|
||||||
# Return the paths to the dependencies of this package.
|
# Return the paths to the dependencies of this package.
|
||||||
result.paths.add pkgDestDir
|
result.paths.add pkgDestDir
|
||||||
|
|
||||||
result.pkg = pkgInfo
|
result.pkg = pkgInfo
|
||||||
|
|
||||||
echo(pkgInfo.name & " installed successfully.")
|
|
||||||
|
|
||||||
proc getNimbleTempDir(): string =
|
proc getNimbleTempDir(): string =
|
||||||
## Returns a path to a temporary directory.
|
## Returns a path to a temporary directory.
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import nimblepkg/config, nimblepkg/version,
|
||||||
type
|
type
|
||||||
Options* = object
|
Options* = object
|
||||||
forcePrompts*: ForcePrompt
|
forcePrompts*: ForcePrompt
|
||||||
|
depsOnly*: bool
|
||||||
queryVersions*: bool
|
queryVersions*: bool
|
||||||
queryInstalled*: bool
|
queryInstalled*: bool
|
||||||
action*: Action
|
action*: Action
|
||||||
|
|
@ -83,6 +84,7 @@ Options:
|
||||||
--ver Query remote server for package version
|
--ver Query remote server for package version
|
||||||
information when searching or listing packages
|
information when searching or listing packages
|
||||||
--nimbleDir dirname Set the Nimble directory.
|
--nimbleDir dirname Set the Nimble directory.
|
||||||
|
-d --depsOnly Install only dependencies.
|
||||||
|
|
||||||
For more information read the Github readme:
|
For more information read the Github readme:
|
||||||
https://github.com/nim-lang/nimble#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 "ver": result.queryVersions = true
|
||||||
of "nimbledir": result.config.nimbleDir = val # overrides option from file
|
of "nimbledir": result.config.nimbleDir = val # overrides option from file
|
||||||
of "installed", "i": result.queryInstalled = true
|
of "installed", "i": result.queryInstalled = true
|
||||||
|
of "depsOnly", "d": result.depsOnly = true
|
||||||
else:
|
else:
|
||||||
raise newException(NimbleError, "Unknown option: --" & flag)
|
raise newException(NimbleError, "Unknown option: --" & flag)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue