提交 30704558 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

not to print lang interpreter config items on windows os

上级 6dbc18a8
package action
import (
"fmt"
commonUtils "github.com/easysoft/zentaoatf/src/utils/common"
fileUtils "github.com/easysoft/zentaoatf/src/utils/file"
i118Utils "github.com/easysoft/zentaoatf/src/utils/i118"
logUtils "github.com/easysoft/zentaoatf/src/utils/log"
"github.com/easysoft/zentaoatf/src/utils/vari"
"os"
"strings"
)
func AddPath() {
ztfPath := strings.TrimRight(vari.ZtfDir, string(os.PathSeparator))
println(ztfPath)
pathEnv := os.Getenv("PATH")
fmt.Println(pathEnv)
if strings.Index(pathEnv, ztfPath) == -1 {
if commonUtils.IsWin() {
} else {
fileUtils.CopyFile("./ztf", "/usr/local/bin")
}
}
pathEnv = os.Getenv("PATH")
fmt.Println(pathEnv)
logUtils.PrintTo(i118Utils.I118Prt.Sprintf("success_add_to_path"))
}
......@@ -8,13 +8,11 @@ type Config struct {
Account string
Password string
Bat string
Javascript string
Lua string
Perl string
Php string
Python string
Ruby string
Shell string
Tcl string
}
......@@ -58,6 +58,10 @@ func PrintCurrConfig() {
val := reflect.ValueOf(vari.Config)
typeOfS := val.Type()
for i := 0; i < reflect.ValueOf(vari.Config).NumField(); i++ {
if !commonUtils.IsWin() && i > 4 {
break
}
val := val.Field(i)
name := typeOfS.Field(i).Name
......
......@@ -119,9 +119,6 @@ func main() {
case "clean", "-clean", "-c":
action.Clean()
//case "addpath", "-a":
// action.AddPath()
case "help", "-h":
logUtils.PrintUsage()
......
rm -rf ztf
mkdir ztf
mkdir ztf/log
cp -r conf ztf/
cp -r demo ztf/
go-bindata -o=res/res.go -pkg=res res/ res/doc res/json res/template
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ztf/ztf.exe src/ztf.go
GO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ztf/ztf-linux src/ztf.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ztf/ztf-mac src/ztf.go
cd ztf
zip -r ztf-win-2.0.RC.zip ztf.exe demo conf log
cp -r ztf-linux ztf
zip -r ztf-linux-2.0.RC.zip ztf demo conf log
cp -r ztf-mac ztf
zip -r ztf-mac-2.0.RC.zip ztf demo conf log
rm ztf
cd ..
\ No newline at end of file
rm -rf ztf
mkdir ztf
mkdir ztf/log
cp -r conf ztf/
cp -r demo ztf/
go-bindata -o=res/res.go -pkg=res res/ res/doc res/json res/template
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ztf/ztf.exe src/ztf.go
GO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ztf/ztf-linux src/ztf.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ztf/ztf-mac src/ztf.go
cd ztf
zip -r ztf-win-2.0.RC.zip ztf.exe demo conf log
cp -r ztf-linux ztf
zip -r ztf-linux-2.0.RC.zip ztf demo conf log
cp -r ztf-mac ztf
zip -r ztf-mac-2.0.RC.zip ztf demo conf log
rm ztf
cd ..
error_log(json_encode($_POST, JSON_FORCE_OBJECT));
Python:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple requests
Ruby:
sudo apt-get install libgmp3-dev
sudo gem install json
\ No newline at end of file
sudo gem install json
error_log(json_encode($_POST, JSON_FORCE_OBJECT));
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册