mirror of
https://github.com/NixOS/nix.git
synced 2025-12-08 18:11:02 +01:00
15 lines
366 B
Python
15 lines
366 B
Python
#!/usr/bin/env python3
|
|
"""Generate redirects.js from template and JSON data."""
|
|
|
|
import sys
|
|
|
|
template_path, json_path, output_path = sys.argv[1:]
|
|
|
|
with open(json_path) as f:
|
|
json_content = f.read().rstrip()
|
|
|
|
with open(template_path) as f:
|
|
template = f.read()
|
|
|
|
with open(output_path, 'w') as f:
|
|
f.write(template.replace('@REDIRECTS_JSON@', json_content))
|