make buildfile.reader.Execute() execute each instruction + log errors
This commit is contained in:
parent
b4a0f14907
commit
1705ff54d8
|
@ -4,6 +4,7 @@ import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.xdrm.io/go/nix-amer/internal/clifmt"
|
||||||
"git.xdrm.io/go/nix-amer/internal/instruction"
|
"git.xdrm.io/go/nix-amer/internal/instruction"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -80,5 +81,15 @@ func (r *Reader) Execute() error {
|
||||||
return fmt.Errorf("cannot upgrade | %s", err)
|
return fmt.Errorf("cannot upgrade | %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 3. exec each instruction
|
||||||
|
for i, inst := range r.Content {
|
||||||
|
_, err := inst.Exec(*r.Context)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("%d | %s\n", i, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
fmt.Printf("%d | %s\n", i, clifmt.Color(32, "done"))
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue