pass env of backends to restic

This commit is contained in:
2021-04-17 13:04:40 +02:00
parent b314912821
commit 276c424106
3 changed files with 14 additions and 2 deletions

View File

@@ -6,6 +6,8 @@ import (
"io"
"os"
"os/exec"
"github.com/cupcakearmy/autorestic/internal/colors"
)
func CheckIfCommandIsCallable(cmd string) bool {
@@ -32,6 +34,10 @@ func ExecuteCommand(options ExecuteOptions, args ...string) (string, error) {
cmd.Env = env
cmd.Dir = options.Dir
if VERBOSE {
colors.Faint.Printf("> Executing: %s\n", cmd)
}
var out bytes.Buffer
var error bytes.Buffer
cmd.Stdout = &out