diff --git a/src/nimble.nim b/src/nimble.nim index f488e2c..2b0d35a 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -223,11 +223,6 @@ proc buildFromDir(pkgInfo: PackageInfo, paths: seq[string], "Nothing to build. Did you specify a module to build using the" & " `bin` key in your .nimble file?") 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 bin in pkgInfo.bin: let outputOpt = "-o:\"" & pkgInfo.getOutputDir(bin) & "\"" @@ -251,9 +246,6 @@ proc buildFromDir(pkgInfo: PackageInfo, paths: seq[string], exc.hint = hint raise exc - cd realDir: - discard execHook(options, false) - proc buildFromDir(pkgInfo: PackageInfo, paths: seq[string], forRelease: bool, options: Options) = var args: seq[string] @@ -368,7 +360,7 @@ proc installFromDir(dir: string, requestedVer: VersionRange, options: Options, # if the build fails then the old package will still be installed. if pkgInfo.bin.len > 0: let paths = result.deps.map(dep => dep.getRealDir()) - var optsCopy = options.briefClone() + let optsCopy = options.briefClone() optsCopy.action.typ = actionBuild buildFromDir(pkgInfo, paths, true, optsCopy)