Skip to content

Commit

Permalink
fixes #1181; nimble setup adds empty lines to config.nims (#1193)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout committed Mar 14, 2024
1 parent 3cc05f4 commit 45282c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nimble.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1959,9 +1959,9 @@ when withDir(thisDir(), system.fileExists("{nimblePathsFileName}")):
startIndex = fileContent.find(sectionStart)
endIndex = fileContent.find(sectionEnd)
if startIndex >= 0 and endIndex >= 0:
fileContent.delete(startIndex..endIndex + sectionEnd.len - 1)

fileContent.append(configFileContent)
fileContent = fileContent[0..<startIndex] & configFileContent[0 ..< ^1] & fileContent[endIndex + sectionEnd.len .. ^1]
else:
fileContent.append(configFileContent)
writeFile = true
else:
fileContent.append(configFileContent)
Expand Down

0 comments on commit 45282c4

Please sign in to comment.