MCPcopy Create free account
hub / github.com/dagger/dagger / ExitCode

Method ExitCode

core/container_exec.go:2246–2259  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

2244}
2245
2246func (container *Container) ExitCode(ctx context.Context) (int, error) {
2247 contents, err := container.metaFileContents(ctx, engineutil.MetaMountExitCodePath)
2248 if err != nil {
2249 return 0, err
2250 }
2251 contents = strings.TrimSpace(contents)
2252
2253 code, err := strconv.ParseInt(contents, 10, 64)
2254 if err != nil {
2255 return 0, fmt.Errorf("could not parse exit code %q: %w", contents, err)
2256 }
2257
2258 return int(code), nil
2259}
2260
2261func (container *Container) metaFileContents(ctx context.Context, filePath string) (string, error) {
2262 if err := container.Evaluate(ctx); err != nil {

Callers 7

compareDirectoriesFunction · 0.45
directoriesAreIdenticalFunction · 0.45
RunRipgrepMethod · 0.45
AsPatchMethod · 0.45
execCLIFunction · 0.45
RunFunction · 0.45

Calls 1

metaFileContentsMethod · 0.95

Tested by

no test coverage detected