Skip to content

Commit 3bf3c93

Browse files
committed
use regex to identify header
1 parent bf64169 commit 3bf3c93

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compas_invocations2/grasshopper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"""
88

99
import os
10+
import re
1011
import shutil
1112
import tempfile
1213
from pathlib import Path
@@ -212,7 +213,7 @@ def publish_yak(ctx, yak_file: str, test_server: bool = False):
212213

213214

214215
def _is_header_line(line: str) -> bool:
215-
return line.startswith("# r:") or line.startswith("# venv:") or line.startswith("# env:")
216+
return re.match(r"^#\s*(r|venv|env):", line) is not None
216217

217218

218219
@invoke.task(

0 commit comments

Comments
 (0)