1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-22 15:57:07 +00:00

Merge pull request #1368 from TobyLL/master

Ignore comments (lines starting with #) in the --files-from file
This commit is contained in:
Alexander Neumann 2017-10-21 12:21:11 +02:00
commit 982810f7cc

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)
}