Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix for #280
  • Loading branch information
genotrance committed Jan 8, 2018
commit 4770556939a7dfd53c608926a6ccf0320dd5e77f
10 changes: 10 additions & 0 deletions src/nimble.nim
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,17 @@ proc install(packages: seq[PkgTuple],
let (downloadDir, downloadVersion) =
downloadPkg(url, pv.ver, meth, options)
try:
# Run pre-install hook in download directory now that package is downloaded
cd downloadDir:
if not execHook(options, true):
raise newException(NimbleError, "Pre-hook prevented further execution.")

result = installFromDir(downloadDir, pv.ver, options, url)

# Run post-install hook in installed directory now that package is installed
# Standard hooks run in current directory so it won't detect this new package
cd result.pkg.myPath.parentDir():
discard execHook(options, false)
except BuildFailed:
# The package failed to build.
# Check if we tried building a tagged version of the package.
Expand Down