summaryrefslogtreecommitdiff
path: root/os.go
diff options
context:
space:
mode:
Diffstat (limited to 'os.go')
-rw-r--r--os.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/os.go b/os.go
index 7eebe41bd..877fa24ca 100644
--- a/os.go
+++ b/os.go
@@ -17,7 +17,14 @@ const assetPrefix string = "/$asset$/"
var fs afero.Fs
func InitOS() {
- fs = afero.NewOsFs()
+ if Perms.FsWrite {
+ assert(Perms.FsRead, "Write access requires read access.")
+ fs = afero.NewOsFs()
+ } else if Perms.FsRead {
+ fs = afero.NewReadOnlyFs(afero.NewOsFs())
+ } else {
+ panic("Not implemented.")
+ }
Sub("os", func(buf []byte) []byte {
msg := &Msg{}