mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-13 20:24:00 +02: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:
@@ -1,8 +1,10 @@
|
||||
package source
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
@@ -93,11 +95,11 @@ func (f *Filesystem) captureFiles() {
|
||||
if ignoreDotFile(filePath) {
|
||||
return nil
|
||||
}
|
||||
file, err := os.Open(filePath)
|
||||
data, err := ioutil.ReadFile(filePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
f.add(filePath, file)
|
||||
f.add(filePath, bytes.NewBuffer(data))
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user