mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
15 lines
291 B
Go
15 lines
291 B
Go
|
package config
|
||
|
|
||
|
import (
|
||
|
"io/fs"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
// ChooseFS returns a local (DirFS) file system when on 'dev' environment and the given go-embed file system otherwise
|
||
|
func ChooseFS(localDir string, embeddedFS fs.FS) fs.FS {
|
||
|
if Get().IsDev() {
|
||
|
return os.DirFS(localDir)
|
||
|
}
|
||
|
return embeddedFS
|
||
|
}
|