parent
ee0bf06f01
commit
2fc3efcd84
1 changed files with 9 additions and 1 deletions
|
|
@ -223,6 +223,11 @@ proc buildFromDir(pkgInfo: PackageInfo, paths: seq[string],
|
||||||
"Nothing to build. Did you specify a module to build using the" &
|
"Nothing to build. Did you specify a module to build using the" &
|
||||||
" `bin` key in your .nimble file?")
|
" `bin` key in your .nimble file?")
|
||||||
let realDir = pkgInfo.getRealDir()
|
let realDir = pkgInfo.getRealDir()
|
||||||
|
|
||||||
|
cd realDir:
|
||||||
|
if not execHook(options, true):
|
||||||
|
raise newException(NimbleError, "Pre-hook prevented further execution.")
|
||||||
|
|
||||||
for path in paths: args.add("--path:\"" & path & "\" ")
|
for path in paths: args.add("--path:\"" & path & "\" ")
|
||||||
for bin in pkgInfo.bin:
|
for bin in pkgInfo.bin:
|
||||||
let outputOpt = "-o:\"" & pkgInfo.getOutputDir(bin) & "\""
|
let outputOpt = "-o:\"" & pkgInfo.getOutputDir(bin) & "\""
|
||||||
|
|
@ -246,6 +251,9 @@ proc buildFromDir(pkgInfo: PackageInfo, paths: seq[string],
|
||||||
exc.hint = hint
|
exc.hint = hint
|
||||||
raise exc
|
raise exc
|
||||||
|
|
||||||
|
cd realDir:
|
||||||
|
discard execHook(options, false)
|
||||||
|
|
||||||
proc buildFromDir(pkgInfo: PackageInfo, paths: seq[string], forRelease: bool,
|
proc buildFromDir(pkgInfo: PackageInfo, paths: seq[string], forRelease: bool,
|
||||||
options: Options) =
|
options: Options) =
|
||||||
var args: seq[string]
|
var args: seq[string]
|
||||||
|
|
@ -360,7 +368,7 @@ proc installFromDir(dir: string, requestedVer: VersionRange, options: Options,
|
||||||
# if the build fails then the old package will still be installed.
|
# if the build fails then the old package will still be installed.
|
||||||
if pkgInfo.bin.len > 0:
|
if pkgInfo.bin.len > 0:
|
||||||
let paths = result.deps.map(dep => dep.getRealDir())
|
let paths = result.deps.map(dep => dep.getRealDir())
|
||||||
let optsCopy = options.briefClone()
|
var optsCopy = options.briefClone()
|
||||||
optsCopy.action.typ = actionBuild
|
optsCopy.action.typ = actionBuild
|
||||||
buildFromDir(pkgInfo, paths, true, optsCopy)
|
buildFromDir(pkgInfo, paths, true, optsCopy)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue