mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Avoid locking the files for an extended amount of time. Sublime Text
doesn't like this and shows an error when modifying a file in rapid succession.
This commit is contained in:
parent
e46148f948
commit
1979f7d9c7
1 changed files with 4 additions and 2 deletions
|
@ -1,8 +1,10 @@
|
||||||
package source
|
package source
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -93,11 +95,11 @@ func (f *Filesystem) captureFiles() {
|
||||||
if ignoreDotFile(filePath) {
|
if ignoreDotFile(filePath) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
file, err := os.Open(filePath)
|
data, err := ioutil.ReadFile(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
f.add(filePath, file)
|
f.add(filePath, bytes.NewBuffer(data))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue