File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,15 @@ const (
18
18
defaultCreateMode = 0666
19
19
)
20
20
21
+ // Default Filesystem representing the root of the os filesystem.
22
+ var Default = & OS {}
23
+
21
24
// OS is a filesystem based on the os filesystem.
22
25
type OS struct {}
23
26
24
27
// New returns a new OS filesystem.
25
28
func New (baseDir string ) billy.Filesystem {
26
- return chroot .New (& OS {} , baseDir )
29
+ return chroot .New (Default , baseDir )
27
30
}
28
31
29
32
func (fs * OS ) Create (filename string ) (billy.File , error ) {
Original file line number Diff line number Diff line change @@ -11,7 +11,11 @@ import (
11
11
// globalMemFs is the global memory fs
12
12
var globalMemFs = memfs .New ()
13
13
14
+ // Default Filesystem representing the root of in-memory filesystem for a
15
+ // js/wasm environment.
16
+ var Default = memfs .New ()
17
+
14
18
// New returns a new OS filesystem.
15
19
func New (baseDir string ) billy.Filesystem {
16
- return chroot .New (globalMemFs , globalMemFs .Join ("/" , baseDir ))
20
+ return chroot .New (Default , Default .Join ("/" , baseDir ))
17
21
}
You can’t perform that action at this time.
0 commit comments