11#!/usr/bin/env python3
2- """Generate Stash-specific subconverter templates from maintained Clash policy."""
2+ """Generate tracked compatibility templates from maintained Clash policy."""
33
44from __future__ import annotations
55
@@ -395,8 +395,16 @@ def generated_outputs(root: Path) -> dict[Path, str]:
395395 return outputs
396396
397397
398+ def compatibility_outputs (root : Path ) -> dict [Path , str ]:
399+ outputs = generated_outputs (root )
400+ outputs [Path ("cfg/Custom_Clash_Mainland.ini" )] = (
401+ root / "cfg" / "Custom_Clash.ini"
402+ ).read_text (encoding = "utf-8" )
403+ return outputs
404+
405+
398406def check_outputs (root : Path , outputs : dict [Path , str ] | None = None ) -> tuple [Path , ...]:
399- expected = outputs if outputs is not None else generated_outputs (root )
407+ expected = outputs if outputs is not None else compatibility_outputs (root )
400408 mismatches = []
401409 for relative_path , content in expected .items ():
402410 path = root / relative_path
@@ -410,14 +418,14 @@ def main() -> int:
410418 parser .add_argument ("--check" , action = "store_true" , help = "check committed outputs" )
411419 args = parser .parse_args ()
412420 root = Path (__file__ ).resolve ().parents [1 ]
413- outputs = generated_outputs (root )
421+ outputs = compatibility_outputs (root )
414422 if args .check :
415423 mismatches = check_outputs (root , outputs )
416424 if mismatches :
417425 for path in mismatches :
418- print (f"outdated generated Stash template: { path .as_posix ()} " )
426+ print (f"outdated generated compatibility template: { path .as_posix ()} " )
419427 return 1
420- print ("generated Stash templates are current" )
428+ print ("generated compatibility templates are current" )
421429 return 0
422430
423431 for relative_path , content in outputs .items ():
0 commit comments