2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-26 20:30:19 +00:00

Ignore comments (lines starting with #) in the --files-from file

This commit is contained in:
TobyLL 2017-10-19 15:48:22 +01:00
parent 7507a658ac
commit 9dba182e51

View File

@ -298,9 +298,14 @@ func readLinesFromFile(filename string) ([]string, error) {
scanner := bufio.NewScanner(r)
for scanner.Scan() {
line := scanner.Text()
// ignore empty lines
if line == "" {
continue
}
// strip comments
if strings.HasPrefix(line, "#") {
continue
}
lines = append(lines, line)
}