MCPcopy Create free account
hub / github.com/LanceLRQ/deer-executor / MakeCompileConfigFile

Function MakeCompileConfigFile

client/generate/config.go:14–36  ·  view source on GitHub ↗

MakeCompileConfigFile 生成编译器配置(程序使用)

(c *cli.Context)

Source from the content-addressed store, hash-verified

12
13// MakeCompileConfigFile 生成编译器配置(程序使用)
14func MakeCompileConfigFile(c *cli.Context) error {
15 config := provider.CompileCommands
16 output := c.String("output")
17 if output == "" {
18 output = "./compilers.json"
19 }
20 s, err := os.Stat(output)
21 if s != nil || os.IsExist(err) {
22 log.Fatal("output file exists")
23 return nil
24 }
25 fp, err := os.OpenFile(output, os.O_WRONLY|os.O_CREATE, 0644)
26 if err != nil {
27 log.Fatalf("open output file error: %s\n", err.Error())
28 return nil
29 }
30 defer fp.Close()
31 _, err = fp.WriteString(utils.ObjectToJSONStringFormatted(config))
32 if err != nil {
33 return err
34 }
35 return nil
36}
37
38// MakeJITMemoryConfigFile 生成JIT内存宽限配置
39func MakeJITMemoryConfigFile(c *cli.Context) error {

Callers

nothing calls this directly

Calls 3

StringMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected