Use document.ReadFile to read #+SETUPFILE
Now that we allow providing a custom ReadFile implementation we should use it everywhere we read files.
This commit is contained in:
parent
9de65240a0
commit
2afd11581c
1 changed files with 1 additions and 2 deletions
|
@ -2,7 +2,6 @@ package org
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io/ioutil"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -143,7 +142,7 @@ func (d *Document) loadSetupFile(k Keyword) (int, Node) {
|
||||||
if !filepath.IsAbs(path) {
|
if !filepath.IsAbs(path) {
|
||||||
path = filepath.Join(filepath.Dir(d.Path), path)
|
path = filepath.Join(filepath.Dir(d.Path), path)
|
||||||
}
|
}
|
||||||
bs, err := ioutil.ReadFile(path)
|
bs, err := d.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
d.Log.Printf("Bad setup file: %#v: %s", k, err)
|
d.Log.Printf("Bad setup file: %#v: %s", k, err)
|
||||||
return 1, k
|
return 1, k
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue