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

Function CompileProblemWorkDirSourceCodes

client/packmgr/compile.go:106–129  ·  view source on GitHub ↗

CompileProblemWorkDirSourceCodes 编译作业代码(APP入口)

(c *cli.Context)

Source from the content-addressed store, hash-verified

104
105// CompileProblemWorkDirSourceCodes 编译作业代码(APP入口)
106func CompileProblemWorkDirSourceCodes(c *cli.Context) error {
107 configFile := c.Args().Get(0)
108 _, err := os.Stat(configFile)
109 if err != nil && os.IsNotExist(err) {
110 return errors.Errorf("problem config file (%s) not found", configFile)
111 }
112 session, err := executor.NewSession(configFile)
113 if err != nil {
114 return err
115 }
116 libDir, err := filepath.Abs(c.String("library"))
117 if err != nil {
118 return errors.Errorf("get library root error: %s", err.Error())
119 }
120 s, err := os.Stat(libDir)
121 if err != nil {
122 return errors.Errorf("library root not exists")
123 }
124 if !s.IsDir() {
125 return errors.Errorf("library root not a directory")
126 }
127 err = compileWorkCodeFiles(session.JudgeConfig, libDir)
128 return err
129}

Callers

nothing calls this directly

Calls 5

NewSessionFunction · 0.92
compileWorkCodeFilesFunction · 0.85
ErrorfMethod · 0.80
StringMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected