mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
rely on stdin/stdout instead of hardcoded paths
This commit is contained in:
@ -10,9 +10,9 @@ be safe and not malicious or anything.
|
|||||||
|
|
||||||
import ast
|
import ast
|
||||||
import math
|
import math
|
||||||
|
import sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from pathlib import Path
|
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
from typing import Literal, TypedDict, cast
|
from typing import Literal, TypedDict, cast
|
||||||
|
|
||||||
@ -236,16 +236,9 @@ def generate_zig_switch_arms(patch_sets: list[PatchSet]) -> str:
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
project_root = Path(__file__).resolve().parents[2]
|
source = sys.stdin.read()
|
||||||
|
|
||||||
patcher_path = project_root / "vendor" / "nerd-fonts" / "font-patcher.py"
|
|
||||||
source = patcher_path.read_text(encoding="utf-8")
|
|
||||||
patch_set = extract_patch_set_values(source)
|
patch_set = extract_patch_set_values(source)
|
||||||
|
print("""//! This is a generated file, produced by nerd_font_codegen.py
|
||||||
out_path = project_root / "src" / "font" / "nerd_font_attributes.zig"
|
|
||||||
|
|
||||||
with out_path.open("w", encoding="utf-8") as f:
|
|
||||||
f.write("""//! This is a generated file, produced by nerd_font_codegen.py
|
|
||||||
//! DO NOT EDIT BY HAND!
|
//! DO NOT EDIT BY HAND!
|
||||||
//!
|
//!
|
||||||
//! This file provides info extracted from the nerd fonts patcher script,
|
//! This file provides info extracted from the nerd fonts patcher script,
|
||||||
@ -255,7 +248,6 @@ const Constraint = @import("face.zig").RenderOptions.Constraint;
|
|||||||
|
|
||||||
/// Get the a constraints for the provided codepoint.
|
/// Get the a constraints for the provided codepoint.
|
||||||
pub fn getConstraint(cp: u21) Constraint {
|
pub fn getConstraint(cp: u21) Constraint {
|
||||||
return switch (cp) {
|
return switch (cp) {""")
|
||||||
""")
|
print(generate_zig_switch_arms(patch_set))
|
||||||
f.write(generate_zig_switch_arms(patch_set))
|
print(" else => .none,\n };\n}")
|
||||||
f.write("\n else => .none,\n };\n}\n")
|
|
||||||
|
Reference in New Issue
Block a user