MCPcopy Create free account
hub / github.com/Scalingo/cli / getFileInfo

Function getFileInfo

deployments/deploy_war.go:120–135  ·  view source on GitHub ↗
(ctx context.Context, warPath string)

Source from the content-addressed store, hash-verified

118}
119
120func getFileInfo(ctx context.Context, warPath string) (io.ReadCloser, int64, string, error) {
121 warSize := int64(0)
122 warFileName := filepath.Base(warPath)
123 fi, err := os.Stat(warPath)
124 if err == nil {
125 // If there is an error, we just skip this header
126 warSize = fi.Size()
127 }
128
129 warReadStream, err := os.Open(warPath)
130 if err != nil {
131 return nil, 0, "", errors.Wrapf(ctx, err, "open WAR file")
132 }
133
134 return warReadStream, warSize, warFileName, nil
135}

Callers 1

DeployWarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected