Skip to content

Commit

Permalink
fixes disruptek/nimph#102 multi-level nim.cfg use (#13001) [backport]
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek authored and Araq committed Dec 31, 2019
1 parent 584e8c8 commit 8a63cac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/nimblecmd.nim
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ proc getPathVersion*(p: string): tuple[name, version: string] =
result.version = ""

const specialSeparator = "-#"
var sepIdx = p.find(specialSeparator)
let last = p.rfind(p.lastPathPart) # the index where the last path part begins
var sepIdx = p.find(specialSeparator, start = last)
if sepIdx == -1:
sepIdx = p.rfind('-')
sepIdx = p.rfind('-', start = last)

if sepIdx == -1:
result.name = p
Expand Down

0 comments on commit 8a63cac

Please sign in to comment.