[scripts/init] implement specifying a site's URL as 'category'

This commit is contained in:
Mike Fährmann
2025-10-02 11:51:32 +02:00
parent 4220cd42c0
commit ddc8c8ae09

View File

@@ -358,6 +358,12 @@ def parse_args(args=None):
args = parser.parse_args()
args.category = args.category.lower()
if "://" in args.category:
base = args.category.split("/", 3)
if not args.root:
args.root = "/".join(base[:3])
args.category = re.sub(r"\W+", "", base[2].split(".")[-2])
if root := args.root:
if "://" in root:
root = root.rstrip("/")