demo/add_blog_license: exit if abbrlink not exist

pull/2/head
q191201771 5 years ago
parent 0a244c553c
commit 14b74f8fc7

@ -65,7 +65,6 @@ func main() {
bytes.Index(lines[len(lines)-2], []byte("版权声明")) != -1 { bytes.Index(lines[len(lines)-2], []byte("版权声明")) != -1 {
skipCount++ skipCount++
return nil return nil
} }
// 获取该文章的url的地址 // 获取该文章的url的地址
@ -77,6 +76,10 @@ func main() {
break break
} }
} }
if abbrlink == "" {
nazalog.Errorf("abbrlink not exist. path=%s", path)
os.Exit(1)
}
// 构造好license信息并添加在文章末尾 // 构造好license信息并添加在文章末尾
modCount++ modCount++

Loading…
Cancel
Save