Fixes with .env file handling and other misc

This commit is contained in:
Paulo Truta
2021-02-20 18:09:41 +00:00
parent 7857985fe4
commit 5e81525635
3 changed files with 12 additions and 6 deletions
+5 -3
View File
@@ -2,9 +2,10 @@ package utils
import (
"bytes"
"fmt"
"log"
"os/exec"
"github.com/joho/godotenv"
)
@@ -15,13 +16,14 @@ func Exec(command string, args []string) string {
var stderr bytes.Buffer
cmd.Stdout = &out
cmd.Stderr = &stderr
cmd.Dir = GetPath("wsPath")
err := cmd.Run()
if err != nil {
// TODO: Deal with possibility of error in command, allow explicit error handling and return proper formatted stderr
// log.Println(fmt.Sprint(err) + ": " + stderr.String()) // ... Silence...
log.Println(fmt.Sprint(err) + ": " + stderr.String()) // ... Silence...
}
// log.Println("Result: " + out.String()) // ... Silence ...
log.Println("Result: " + out.String()) // ... Silence ...
return out.String()