2018-11-08 13:09:32 +00:00
|
|
|
package main
|
|
|
|
|
2018-11-10 11:37:31 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"git.xdrm.io/xdrm-brackets/nix-amer/internal/buildfile"
|
|
|
|
"git.xdrm.io/xdrm-brackets/nix-amer/internal/clifmt"
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
2018-11-08 13:09:32 +00:00
|
|
|
func main() {
|
2018-11-10 11:37:31 +00:00
|
|
|
|
|
|
|
// Manage arguments
|
|
|
|
ctx, bf, err := GetArgs()
|
|
|
|
if err != nil {
|
|
|
|
fmt.Printf("%s", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// 1. get buildfile reader
|
|
|
|
bfreader, err := os.Open(bf)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Printf("cannot open buildfile | %s\n", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
defer bfreader.Close()
|
|
|
|
|
|
|
|
// 2. parse buildfile
|
|
|
|
_, err = buildfile.NewReader(ctx, bfreader)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Printf("%s%s\n", bf, err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
clifmt.Align("build file")
|
|
|
|
fmt.Printf("%s\n", clifmt.Color(32, "parsed"))
|
|
|
|
|
2018-11-08 13:09:32 +00:00
|
|
|
}
|