fix Id duplicates
This commit is contained in:
parent
8ea36234a9
commit
7ed3c128f4
1 changed files with 3 additions and 3 deletions
6
tree.go
6
tree.go
|
@ -243,7 +243,7 @@ func addMissingId(dir string, id int64) error {
|
||||||
scanner.Split(bufio.ScanLines)
|
scanner.Split(bufio.ScanLines)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := scanner.Text()
|
line := scanner.Text()
|
||||||
if strings.HasPrefix(line, "id:") {
|
if strings.HasPrefix(line, "* id:") {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if line == "---" {
|
if line == "---" {
|
||||||
|
@ -299,8 +299,8 @@ func getMaxId(dir string) (int64, error) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(line, "id:") {
|
if strings.HasPrefix(line, "* id:") {
|
||||||
line = strings.TrimPrefix(line, "id:")
|
line = strings.TrimPrefix(line, "* id:")
|
||||||
i := abcex.Decode(strings.Trim(line, " "))
|
i := abcex.Decode(strings.Trim(line, " "))
|
||||||
if i > max {
|
if i > max {
|
||||||
max = i
|
max = i
|
||||||
|
|
Loading…
Reference in a new issue