mirror of
https://github.com/octoleo/restic.git
synced 2025-01-11 02:08:44 +00:00
parent
525db875b0
commit
c796d84fca
@ -415,11 +415,20 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, args []string) error {
|
|||||||
|
|
||||||
scanner := bufio.NewScanner(file)
|
scanner := bufio.NewScanner(file)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := scanner.Text()
|
line := strings.TrimSpace(scanner.Text())
|
||||||
if !strings.HasPrefix(line, "#") {
|
|
||||||
line = os.ExpandEnv(line)
|
// ignore empty lines
|
||||||
opts.Excludes = append(opts.Excludes, line)
|
if line == "" {
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// strip comments
|
||||||
|
if strings.HasPrefix(line, "#") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
line = os.ExpandEnv(line)
|
||||||
|
opts.Excludes = append(opts.Excludes, line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user