generated from john/python-template
ci: verify green gate with platform-independent prompt name guard
Quality Gate / gate (push) Successful in 35s
Quality Gate / gate (push) Successful in 35s
This commit is contained in:
@@ -104,8 +104,11 @@ class PromptStore:
|
||||
|
||||
def _resolve_existing_prompt(self, name: str) -> Path:
|
||||
normalized_name = name.strip()
|
||||
# Path().name is platform-dependent: POSIX treats "\" as an ordinary filename
|
||||
# character, so reject both separators explicitly to match config.PromptFilename.
|
||||
if (
|
||||
not normalized_name
|
||||
or any(separator in normalized_name for separator in ("/", "\\"))
|
||||
or Path(normalized_name).name != normalized_name
|
||||
or Path(normalized_name).suffix.lower() != PROMPT_EXTENSION
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user