Fix stub addition to type block
This commit is contained in:
parent
54dfd61b1b
commit
90e81aa472
1 changed files with 5 additions and 3 deletions
|
|
@ -222,9 +222,11 @@ proc main(
|
||||||
|
|
||||||
# Include in wrapper file
|
# Include in wrapper file
|
||||||
data = outputFile.readFile()
|
data = outputFile.readFile()
|
||||||
if "type\n" in data:
|
let
|
||||||
# In existing type block
|
idx = data.find("\ntype\n")
|
||||||
data = data.replace("type\n", "type\n" & stubData)
|
if idx != -1:
|
||||||
|
# In first existing type block
|
||||||
|
data = data[0 ..< idx+6] & stubData & data[idx+6 .. ^1]
|
||||||
else:
|
else:
|
||||||
# At the top if none already
|
# At the top if none already
|
||||||
data = "type\n" & stubData & data
|
data = "type\n" & stubData & data
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue