2016-04-15 08:54:02 +00:00
|
|
|
// +build ignore
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2018-03-20 03:26:51 +00:00
|
|
|
"fmt"
|
2016-04-15 08:54:02 +00:00
|
|
|
"os"
|
|
|
|
"path/filepath"
|
2018-03-20 03:26:51 +00:00
|
|
|
|
|
|
|
bindata "github.com/jteeuwen/go-bindata"
|
2016-04-15 08:54:02 +00:00
|
|
|
)
|
|
|
|
|
2018-03-20 03:26:51 +00:00
|
|
|
// Reads image.tar and saves the binary data in image/bindata.go.
|
2016-04-15 08:54:02 +00:00
|
|
|
func main() {
|
|
|
|
wd, err := os.Getwd()
|
|
|
|
if err != nil {
|
2018-03-20 03:26:51 +00:00
|
|
|
fmt.Fprintf(os.Stderr, "os.Getwd: %v\n", err)
|
|
|
|
os.Exit(1)
|
2016-04-15 08:54:02 +00:00
|
|
|
}
|
2018-03-20 03:26:51 +00:00
|
|
|
|
2016-04-15 08:54:02 +00:00
|
|
|
tarPath := filepath.Join(wd, "image.tar")
|
|
|
|
|
2018-03-20 03:26:51 +00:00
|
|
|
// Create the bindata config.
|
|
|
|
bc := bindata.NewConfig()
|
|
|
|
bc.Input = []bindata.InputConfig{
|
|
|
|
{
|
|
|
|
Path: tarPath,
|
|
|
|
Recursive: false,
|
|
|
|
},
|
2016-04-15 08:54:02 +00:00
|
|
|
}
|
2018-03-20 03:26:51 +00:00
|
|
|
bc.Output = filepath.Join(wd, "image", "bindata.go")
|
|
|
|
bc.Package = "image"
|
|
|
|
bc.NoMetadata = true
|
|
|
|
bc.Prefix = wd
|
2016-04-15 08:54:02 +00:00
|
|
|
|
2018-03-20 03:26:51 +00:00
|
|
|
if err := bindata.Translate(bc); err != nil {
|
|
|
|
fmt.Fprintf(os.Stderr, "bindata: %v\n", err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2016-04-15 08:54:02 +00:00
|
|
|
}
|