fixes disruptek/nimph#102 multi-level nim.cfg use (#13001) [backport]
This commit is contained in:
parent
584e8c8283
commit
8a63caca07
1 changed files with 3 additions and 2 deletions
|
|
@ -69,9 +69,10 @@ proc getPathVersion*(p: string): tuple[name, version: string] =
|
||||||
result.version = ""
|
result.version = ""
|
||||||
|
|
||||||
const specialSeparator = "-#"
|
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:
|
if sepIdx == -1:
|
||||||
sepIdx = p.rfind('-')
|
sepIdx = p.rfind('-', start = last)
|
||||||
|
|
||||||
if sepIdx == -1:
|
if sepIdx == -1:
|
||||||
result.name = p
|
result.name = p
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue