Skip to content

Commit

Permalink
0.6.18: fixes #112; --path dupes
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Jan 20, 2020
1 parent 783296a commit 80effae
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nimph.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "0.6.17"
version = "0.6.18"
author = "disruptek"
description = "nim package handler from the future"
license = "MIT"
Expand Down
27 changes: 27 additions & 0 deletions src/nimph/project.nim
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,28 @@ proc removeSearchPath*(project: Project; path: string): bool =
## remove a search path from the project's nim.cfg
result = project.cfg.removeSearchPath(project.nimCfg, path)

proc removeSearchPath*(project: var Project; path: string): bool =
## remove a search path from the project's nim.cfg; reload config
let
readonly = project
result = readonly.removeSearchPath(path)
if result:
if not project.fetchConfig(force = true):
warn &"unable to read config for {project}"

proc excludeSearchPath*(project: Project; path: string): bool =
## exclude a search path from the project's nim.cfg
result = project.cfg.excludeSearchPath(project.nimCfg, path)

proc excludeSearchPath*(project: var Project; path: string): bool =
## exclude a search path from the project's nim.cfg; reload config
let
readonly = project
result = readonly.excludeSearchPath(path)
if result:
if not project.fetchConfig(force = true):
warn &"unable to read config for {project}"

proc addSearchPath*(project: Project; path: string): bool =
## add a search path to the given project's configuration;
## true if we added the search path
Expand All @@ -725,6 +743,15 @@ proc addSearchPath*(project: Project; path: string): bool =
raise newException(Defect, "load a configuration first")
result = project.cfg.addSearchPath(project.nimCfg, path)

proc addSearchPath*(project: var Project; path: string): bool =
## add a search path to the project's nim.cfg; reload config
let
readonly = project
result = readonly.addSearchPath(path)
if result:
if not project.fetchConfig(force = true):
warn &"unable to read config for {project}"

proc determineSearchPath(project: Project): string =
## produce the search path to add for a given project
if project.dump == nil:
Expand Down

0 comments on commit 80effae

Please sign in to comment.