This commit is contained in:
Liang Ding 2022-08-08 13:58:26 +08:00
parent b2bcec6ea0
commit effb602c62
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
9 changed files with 31 additions and 322 deletions

View file

@ -85,7 +85,7 @@ func ListNotebooks() (ret []*Box, err error) {
boxConf := conf.NewBoxConf()
boxConfPath := filepath.Join(util.DataDir, dir.Name(), ".siyuan", "conf.json")
if !gulu.File.IsExist(boxConfPath) {
if isUserGuide(dir.Name()) {
if IsUserGuide(dir.Name()) {
filelock.ReleaseAllFileLocks()
os.RemoveAll(filepath.Join(util.DataDir, dir.Name()))
logging.LogWarnf("not found user guid box conf [%s], removed it", boxConfPath)

View file

@ -89,7 +89,7 @@ func RemoveBox(boxID string) (err error) {
}
filelock.ReleaseFileLocks(localPath)
if !isUserGuide(boxID) {
if !IsUserGuide(boxID) {
var historyDir string
historyDir, err = util.GetHistoryDir("delete")
if nil != err {
@ -148,7 +148,7 @@ func Mount(boxID string) (alreadyMount bool, err error) {
localPath := filepath.Join(util.DataDir, boxID)
var reMountGuide bool
if isUserGuide(boxID) {
if IsUserGuide(boxID) {
// 重新挂载帮助文档
guideBox := Conf.Box(boxID)
@ -214,6 +214,6 @@ func Mount(boxID string) (alreadyMount bool, err error) {
return false, nil
}
func isUserGuide(boxID string) bool {
func IsUserGuide(boxID string) bool {
return "20210808180117-czj9bvb" == boxID || "20210808180117-6v0mkxr" == boxID || "20211226090932-5lcq56f" == boxID
}