Skip to content

Commit a9643c0

Browse files
amondnetCopilot
andcommitted
Update src/specify_cli/__init__.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 0933175 commit a9643c0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/specify_cli/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,13 +700,15 @@ def download_and_extract_template(project_path: Path, ai_assistant: str, script_
700700
return project_path
701701

702702

703+
UTF8_BOM = b'\xef\xbb\xbf'
704+
703705
def _has_shebang(file_path: Path) -> bool:
704706
"""Check if file has shebang, handling UTF-8 BOM."""
705707
try:
706708
with file_path.open("rb") as f:
707709
head = f.read(5)
708710
# Skip UTF-8 BOM if present
709-
if head.startswith(b'\xef\xbb\xbf'):
711+
if head.startswith(UTF8_BOM):
710712
head = head[3:]
711713
return head.startswith(b"#!")
712714
except Exception:

0 commit comments

Comments
 (0)