From 582d347c3ea34744f3b0256018e24ecdaae6e952 Mon Sep 17 00:00:00 2001 From: ii64 Date: Thu, 17 Dec 2020 10:04:25 +0700 Subject: [PATCH] test ci result fx --- .github/workflows/go.yml | 2 +- .gitignore | 5 ++++- cli/go.sum | 1 + cli/make.bat | 1 + cli/tanem.go | 5 +++-- emulator.go | 9 ++++++--- 6 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 cli/make.bat diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 60a1f0b..191757c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -43,7 +43,7 @@ jobs: run: | mkdir build/linux_amd64 cp -a "./cli/deps/lib" build/linux_amd64/lib - GOOS=linux GOARCH=amd64 go build -x -v -o build/linux_amd64/tanem $CLINAME + GOOS=linux GOARCH=amd64 go build -x -v -o build/linux_amd64/tanem cli/tanem.go zip -r ./tanem-linux-amd64.zip --junk-paths build/linux_amd64/* - name: Create Release diff --git a/.gitignore b/.gitignore index f7b3492..ac6ca46 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,7 @@ *.out # Dependency directories (remove the comment below to include it) -# vendor/ \ No newline at end of file +# vendor/ + +# +vfs/ \ No newline at end of file diff --git a/cli/go.sum b/cli/go.sum index 32ecf89..245977f 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -29,6 +29,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= diff --git a/cli/make.bat b/cli/make.bat new file mode 100644 index 0000000..942e66d --- /dev/null +++ b/cli/make.bat @@ -0,0 +1 @@ +go build -i -v -x tanem.go \ No newline at end of file diff --git a/cli/tanem.go b/cli/tanem.go index 273d3b4..4c84696 100644 --- a/cli/tanem.go +++ b/cli/tanem.go @@ -2,12 +2,13 @@ package main import ( "os" - "fmt" + //"fmt" "github.com/ii64/tanem/cmd" ) func main() { if err := cmd.NewTanemCmd(os.Args); err != nil { - fmt.Printf("[ERR]: %s", err) + //fmt.Printf("[ERR]: %s", err) + panic(err) } } \ No newline at end of file diff --git a/emulator.go b/emulator.go index a4f4620..80c8456 100644 --- a/emulator.go +++ b/emulator.go @@ -36,6 +36,7 @@ type Options struct { VfpInstSet bool LogColor bool LogAs int + Config *Config } func NewDefaultOptions() *Options { return &Options{ @@ -90,9 +91,11 @@ func NewEmulator(opt *Options) (*Emulator, error) { config: NewDefaultConfig(), Mu: mu, } - err = LoadOrCreateConfig(opt.ConfigPath, emu.config) - if err != nil { - return nil, err + if opt.Config != nil { + err = LoadOrCreateConfig(opt.ConfigPath, emu.config) + if err != nil { + return nil, err + } } emu.configPath = opt.ConfigPath emu.vfsRoot = opt.VfsRoot