sync: Expose sync.Exists function
This commit is contained in:
parent
5cf4565573
commit
c5a059bd3b
8 changed files with 31 additions and 31 deletions
|
@ -142,9 +142,9 @@ func BuildTheme(i Importer, tdir string) (th *fic.Theme, exceptions *CheckExcept
|
|||
|
||||
var intro string
|
||||
var err error
|
||||
if i.exists(path.Join(tdir, "overview.txt")) {
|
||||
if i.Exists(path.Join(tdir, "overview.txt")) {
|
||||
intro, err = GetFileContent(i, path.Join(tdir, "overview.txt"))
|
||||
} else if i.exists(path.Join(tdir, "overview.md")) {
|
||||
} else if i.Exists(path.Join(tdir, "overview.md")) {
|
||||
intro, err = GetFileContent(i, path.Join(tdir, "overview.md"))
|
||||
} else {
|
||||
err = fmt.Errorf("unable to find overview.txt nor overview.md")
|
||||
|
@ -180,21 +180,21 @@ func BuildTheme(i Importer, tdir string) (th *fic.Theme, exceptions *CheckExcept
|
|||
}
|
||||
}
|
||||
|
||||
if i.exists(path.Join(tdir, "heading.jpg")) {
|
||||
if i.Exists(path.Join(tdir, "heading.jpg")) {
|
||||
th.Image = path.Join(tdir, "heading.jpg")
|
||||
} else if i.exists(path.Join(tdir, "heading.png")) {
|
||||
} else if i.Exists(path.Join(tdir, "heading.png")) {
|
||||
th.Image = path.Join(tdir, "heading.png")
|
||||
} else {
|
||||
errs = append(errs, NewThemeError(th, fmt.Errorf("heading.jpg: No such file")))
|
||||
}
|
||||
|
||||
if i.exists(path.Join(tdir, "partner.jpg")) {
|
||||
if i.Exists(path.Join(tdir, "partner.jpg")) {
|
||||
th.PartnerImage = path.Join(tdir, "partner.jpg")
|
||||
} else if i.exists(path.Join(tdir, "partner.png")) {
|
||||
} else if i.Exists(path.Join(tdir, "partner.png")) {
|
||||
th.PartnerImage = path.Join(tdir, "partner.png")
|
||||
}
|
||||
|
||||
if i.exists(path.Join(tdir, "partner.txt")) {
|
||||
if i.Exists(path.Join(tdir, "partner.txt")) {
|
||||
if txt, err := GetFileContent(i, path.Join(tdir, "partner.txt")); err != nil {
|
||||
errs = append(errs, NewThemeError(th, fmt.Errorf("unable to get partner's text: %w", err)))
|
||||
} else {
|
||||
|
|
Reference in a new issue