From 7fea8e88a4d175c86bbd7a829e5eec477de240f3 Mon Sep 17 00:00:00 2001 From: shy Date: Sat, 1 Mar 2025 11:36:50 +0800 Subject: [PATCH] add some --- core/code/compile.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 {