nix-amer/cmd/nix-amer/main.go

38 lines
638 B
Go
Raw Normal View History

2018-11-08 13:09:32 +00:00
package main
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() {
// 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
}