Skip to content

Commit

Permalink
scripts/rust-libc: search configuration in script directory
Browse files Browse the repository at this point in the history
  • Loading branch information
no92 committed Mar 29, 2024
1 parent 87536b4 commit 611f94e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/rust-libc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import argparse
import io
import os
import pathlib
import string
import sys
Expand Down Expand Up @@ -667,12 +668,12 @@ def parse(file: pathlib.Path, base_dir: pathlib.Path):

colorama.just_fix_windows_console()

with io.open("scripts/rust-libc-config.yml", "r") as f:
with io.open(os.path.join(os.path.dirname(__file__), "rust-libc-config.yml"), "r") as f:
config = yaml.load(f, yaml.CSafeLoader)

path = pathlib.Path(args.path)

with io.open("scripts/rust-libc-header.rs", "r") as f:
with io.open(os.path.join(os.path.dirname(__file__), "rust-libc-header.rs"), "r") as f:
emit(f.read())

state = State()
Expand Down

0 comments on commit 611f94e

Please sign in to comment.