From 96a20b92784a5e90de86094cee78e0be3ce252fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20W=C3=B3jcik?= Date: Fri, 19 Jan 2024 21:11:21 +0100 Subject: [PATCH] Support for comments --- src/pathsd.nim | 3 ++- tests/fixtures/paths.d/01-bilbo | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pathsd.nim b/src/pathsd.nim index a6f6f3c..d7cb728 100644 --- a/src/pathsd.nim +++ b/src/pathsd.nim @@ -52,7 +52,8 @@ proc readPart(path: Path): seq[string] = try: var line: string = readLine(pathFile) while line != "": - result.add(line) + if line.startsWith("#") == false: + result.add(line) line = readLine(pathFile) except EOFError as exception: discard diff --git a/tests/fixtures/paths.d/01-bilbo b/tests/fixtures/paths.d/01-bilbo index b097f03..c3cd82e 100644 --- a/tests/fixtures/paths.d/01-bilbo +++ b/tests/fixtures/paths.d/01-bilbo @@ -1 +1,2 @@ /Users/bilbo/opt/bin +#/Users/bilbo/.local/bin