Skip to content

Commit

Permalink
1.8.12: add findTarget fence
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Nov 25, 2019
1 parent 0662f60 commit ff0748d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions bump.nim
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ proc newTarget*(path: string): Target =
let splat = path.splitFile
result = (repo: splat.dir, package: splat.name, ext: splat.ext)

proc findTargetWith(dir: string; cwd: proc (): string;
target = ""; extensions = defaultExts): SearchResult =
proc findTargetWith(dir: string; cwd: proc (): string; target = "";
ascend = true; extensions = defaultExts): SearchResult =
## locate one, and only one, nimble file to work upon; dir is where
## to start looking, target is a .nimble or package name

Expand Down Expand Up @@ -155,7 +155,7 @@ proc findTargetWith(dir: string; cwd: proc (): string;
break

# we might be good to go, here
if result.found.isSome:
if result.found.isSome or not ascend:
return

# otherwise, maybe we can recurse up the directory tree.
Expand Down Expand Up @@ -185,13 +185,13 @@ proc findTarget*(dir: string; target = ""): SearchResult =
## to start looking, target is a .nimble or package name
result = findTargetWith(dir, safeCurrentDir, target = target)

proc findTarget*(dir: string; target = "";
proc findTarget*(dir: string; target = ""; ascend = true;
extensions: seq[string]): SearchResult =
## locate one, and only one, nimble file to work upon; dir is where
## to start looking, target is a .nimble or package name,
## extensions list optional extensions (such as "nimble")
result = findTargetWith(dir, safeCurrentDir, target = target,
extensions = extensions)
ascend = ascend, extensions = extensions)

proc createTemporaryFile*(prefix: string; suffix: string): string =
## it SHOULD create the file, but so far, it only returns the filename
Expand Down
2 changes: 1 addition & 1 deletion bump.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "1.8.11"
version = "1.8.12"
author = "disruptek"
description = "a tiny tool to bump nimble versions"
license = "MIT"
Expand Down

0 comments on commit ff0748d

Please sign in to comment.