mirror of
https://github.com/dnote/dnote
synced 2026-03-16 07:25:49 +01:00
22 lines
334 B
Go
22 lines
334 B
Go
package upgrade
|
|
|
|
import (
|
|
"github.com/dnote-io/cli/utils"
|
|
"gopkg.in/yaml.v2"
|
|
)
|
|
|
|
func isYAML(b []byte) bool {
|
|
var note utils.YAMLDnote
|
|
|
|
err := yaml.Unmarshal(b, ¬e)
|
|
return err == nil
|
|
}
|
|
|
|
func isDnoteUsingYAML() (bool, error) {
|
|
b, err := utils.ReadNoteContent()
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
|
|
return isYAML(b), nil
|
|
}
|