mirror of
https://github.com/octoleo/restic.git
synced 2025-02-08 22:58:24 +00:00
Merge pull request #1368 from TobyLL/master
Ignore comments (lines starting with #) in the --files-from file
This commit is contained in:
commit
982810f7cc
@ -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…
x
Reference in New Issue
Block a user