Merge pull request #497 from Thor77/excludeFileExpandEnv

Expand environment-variables in exclude-files
This commit is contained in:
Alexander Neumann
2016-04-18 21:40:30 +02:00
2 changed files with 7 additions and 5 deletions
+5 -4
View File
@@ -6,15 +6,15 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"time"
"golang.org/x/crypto/ssh/terminal"
"restic"
"restic/backend"
"restic/debug"
"restic/filter"
"restic/repository"
"strings"
"time"
"golang.org/x/crypto/ssh/terminal"
)
type CmdBackup struct {
@@ -313,6 +313,7 @@ func (cmd CmdBackup) Execute(args []string) error {
for scanner.Scan() {
line := scanner.Text()
if !strings.HasPrefix(line, "#") {
line = os.ExpandEnv(line)
cmd.Excludes = append(cmd.Excludes, line)
}
}