()
| 21 | ` |
| 22 | |
| 23 | func main() { |
| 24 | var outputZip string |
| 25 | flag.StringVar(&outputZip, "o", "", "") |
| 26 | flag.StringVar(&outputZip, "output", "", "") |
| 27 | flag.Usage = func() { |
| 28 | fmt.Fprint(os.Stderr, usage) |
| 29 | } |
| 30 | flag.Parse() |
| 31 | if len(flag.Args()) == 0 { |
| 32 | log.Fatal("no input provided") |
| 33 | } |
| 34 | inputExe := flag.Arg(0) |
| 35 | if outputZip == "" { |
| 36 | outputZip = fmt.Sprintf("%s.zip", filepath.Base(inputExe)) |
| 37 | } |
| 38 | if err := compressExeAndArgs(outputZip, inputExe, flag.Args()[1:]); err != nil { |
| 39 | log.Fatalf("failed to compress file: %v", err) |
| 40 | } |
| 41 | log.Printf("wrote %s", outputZip) |
| 42 | } |
| 43 | |
| 44 | func writeExe(writer *zip.Writer, pathInZip string, data []byte) error { |
| 45 | if pathInZip != "bootstrap" { |
nothing calls this directly
no test coverage detected
searching dependent graphs…