| 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "flag" |
| 6 | "os" |
| 7 | |
| 8 | "github.com/tonistiigi/fsutil" |
| 9 | "github.com/tonistiigi/fsutil/util" |
| 10 | ) |
| 11 | |
| 12 | func main() { |
| 13 | flag.Parse() |
| 14 | if len(flag.Args()) == 0 { |
| 15 | panic("source path not set") |
| 16 | } |
| 17 | |
| 18 | ctx := context.Background() |
| 19 | s := util.NewProtoStream(ctx, os.Stdin, os.Stdout) |
| 20 | |
| 21 | fs, err := fsutil.NewFS(flag.Args()[0]) |
| 22 | if err != nil { |
| 23 | panic(err) |
| 24 | } |
| 25 | if err := fsutil.Send(ctx, s, fs, nil); err != nil { |
| 26 | panic(err) |
| 27 | } |
| 28 | } |