diff --git a/core/code/compile.go b/core/code/compile.go index 086848d7..2e32ed5a 100644 --- a/core/code/compile.go +++ b/core/code/compile.go @@ -1,7 +1,6 @@ package code import ( - "os" "path" "runtime" "strings" @@ -119,10 +118,9 @@ func init() { m.Options(cli.CMD_ENV, env).Cmd(AUTOGEN, VERSION) _compile_get(m, main) defer m.StatusTime(VERSION, strings.TrimPrefix(GoVersion(m), "go version")) - args := []string{main, ice.SRC_VERSION_GO, ice.SRC_BINPACK_GO, ice.SRC_BINPACK_USR_GO} - if _, e := os.Stat("src/option.go"); e == nil { - args = append(args, "src/option.go") - } + args := []string{main, ice.SRC_VERSION_GO} + nfs.Exists(m, "src/option.go", func(p string) { args = append(args, p) }) + kit.If(file != ice.BIN_ICE_BIN, func() { args = append(args, ice.SRC_BINPACK_GO, ice.SRC_BINPACK_USR_GO) }) if msg := GoBuild(m.Spawn(), file, args...); !cli.IsSuccess(msg) { m.Copy(msg) } else {