forked from TrueCloudLab/restic
Ignore comments (lines starting with #) in the --files-from file
This commit is contained in:
parent
7507a658ac
commit
9dba182e51
1 changed files with 5 additions and 0 deletions
|
@ -298,9 +298,14 @@ func readLinesFromFile(filename string) ([]string, error) {
|
||||||
scanner := bufio.NewScanner(r)
|
scanner := bufio.NewScanner(r)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := scanner.Text()
|
line := scanner.Text()
|
||||||
|
// ignore empty lines
|
||||||
if line == "" {
|
if line == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// strip comments
|
||||||
|
if strings.HasPrefix(line, "#") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
lines = append(lines, line)
|
lines = append(lines, line)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue