createJar writes a JAR file at jarPath containing META-INF/MANIFEST.MF with the given content.
(jarPath, manifestContent string)
| 15 | |
| 16 | // createJar writes a JAR file at jarPath containing META-INF/MANIFEST.MF with the given content. |
| 17 | func createJar(jarPath, manifestContent string) error { |
| 18 | buf := new(bytes.Buffer) |
| 19 | w := zip.NewWriter(buf) |
| 20 | f, err := w.Create("META-INF/MANIFEST.MF") |
| 21 | if err != nil { |
| 22 | return err |
| 23 | } |
| 24 | if _, err := f.Write([]byte(manifestContent)); err != nil { |
| 25 | return err |
| 26 | } |
| 27 | if err := w.Close(); err != nil { |
| 28 | return err |
| 29 | } |
| 30 | return os.WriteFile(jarPath, buf.Bytes(), 0644) |
| 31 | } |
| 32 | |
| 33 | var _ = Describe("Java Main Container", func() { |
| 34 | var ( |
no test coverage detected