2021-04-26 12:50:38 +00:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
"os/exec"
|
|
|
|
|
2021-04-27 20:54:22 +00:00
|
|
|
"github.com/fatih/color"
|
2021-04-26 12:50:38 +00:00
|
|
|
"github.com/spf13/viper"
|
|
|
|
)
|
|
|
|
|
|
|
|
var filesToAssemble []string
|
|
|
|
|
|
|
|
const Merlin32Path = "/usr/local/bin/merlin32"
|
|
|
|
|
|
|
|
func Assemble() {
|
|
|
|
//fmt.Println("asm called")
|
|
|
|
filesToAssemble = viper.GetViper().GetStringSlice("assemble")
|
|
|
|
|
|
|
|
//fmt.Fprintln(os.Stderr, "HEY", filesToAssemble)
|
|
|
|
|
|
|
|
for _, filename := range filesToAssemble {
|
|
|
|
fmt.Printf("Assembling %v\n", filename)
|
|
|
|
|
2021-04-27 20:54:22 +00:00
|
|
|
out, err := exec.Command(Merlin32Path, "-V", filename).Output()
|
2021-04-26 12:50:38 +00:00
|
|
|
|
|
|
|
if err != nil {
|
2021-04-27 20:54:22 +00:00
|
|
|
color.Cyan(string(out))
|
2021-04-26 12:50:38 +00:00
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|