projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e46148f
)
Avoid locking the files for an extended amount of time. Sublime Text
author
Egon Elbre
<egonelbre@gmail.com>
Sun, 15 Dec 2013 14:49:23 +0000
(16:49 +0200)
committer
spf13
<steve.francia@gmail.com>
Sat, 28 Dec 2013 18:46:09 +0000
(13:46 -0500)
doesn't like this and shows an error when modifying a file in rapid
succession.
source/filesystem.go
patch
|
blob
|
history
diff --git
a/source/filesystem.go
b/source/filesystem.go
index f44f003f08fd549f4a68ca932d389a0a48afee1e..cefe4a950fc15643798ac8cf7840428f2ce81fee 100644
(file)
--- a/
source/filesystem.go
+++ b/
source/filesystem.go
@@
-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
}
}