mirror of https://github.com/dirtbags/moth.git
parent
dfecd100b8
commit
7c5b5b5ccf
|
@ -5,6 +5,6 @@
|
||||||
__debug_bin
|
__debug_bin
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
transpile
|
transpile
|
||||||
mothd
|
|
||||||
winmoth.*.zip
|
winmoth.*.zip
|
||||||
*.exe
|
/mothd
|
||||||
|
/*.exe
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"mime"
|
"mime"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
|
@ -54,21 +55,38 @@ func main() {
|
||||||
)
|
)
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
var theme *Theme
|
||||||
osfs := afero.NewOsFs()
|
osfs := afero.NewOsFs()
|
||||||
theme := NewTheme(afero.NewBasePathFs(osfs, *themePath))
|
if p, err := filepath.Abs(*themePath); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
} else {
|
||||||
|
theme = NewTheme(afero.NewBasePathFs(osfs, p))
|
||||||
|
}
|
||||||
|
|
||||||
config := Configuration{}
|
config := Configuration{}
|
||||||
|
|
||||||
var provider PuzzleProvider
|
var provider PuzzleProvider
|
||||||
provider = NewMothballs(afero.NewBasePathFs(osfs, *mothballPath))
|
if p, err := filepath.Abs(*mothballPath); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
} else {
|
||||||
|
provider = NewMothballs(afero.NewBasePathFs(osfs, p))
|
||||||
|
}
|
||||||
if *puzzlePath != "" {
|
if *puzzlePath != "" {
|
||||||
provider = NewTranspilerProvider(afero.NewBasePathFs(osfs, *puzzlePath))
|
if p, err := filepath.Abs(*puzzlePath); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
} else {
|
||||||
|
provider = NewTranspilerProvider(afero.NewBasePathFs(osfs, p))
|
||||||
|
}
|
||||||
config.Devel = true
|
config.Devel = true
|
||||||
log.Println("-=- You are in development mode, champ! -=-")
|
log.Println("-=- You are in development mode, champ! -=-")
|
||||||
}
|
}
|
||||||
|
|
||||||
var state StateProvider
|
var state StateProvider
|
||||||
state = NewState(afero.NewBasePathFs(osfs, *statePath))
|
if p, err := filepath.Abs(*statePath); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
} else {
|
||||||
|
state = NewState(afero.NewBasePathFs(osfs, p))
|
||||||
|
}
|
||||||
if config.Devel {
|
if config.Devel {
|
||||||
state = NewDevelState(state)
|
state = NewDevelState(state)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue