diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2022-06-20 06:22:16 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-20 06:22:16 +0000 |
| commit | a1484f66290517b6c36f2e82c92613f23d2c4935 (patch) | |
| tree | f0a590ef6deac0c23c932773354fc4f75903953a /codegen/lib/code/utils.py | |
| parent | e2553bbaf2a550f4941b924e703a922345a1389f (diff) | |
| parent | 405a00c0d1908a4b3fbd8e6684c77dfb178ac55d (diff) | |
| download | azalea-drasl-a1484f66290517b6c36f2e82c92613f23d2c4935.tar.xz | |
Merge branch 'main' into 1.19.1
Diffstat (limited to 'codegen/lib/code/utils.py')
| -rw-r--r-- | codegen/lib/code/utils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/codegen/lib/code/utils.py b/codegen/lib/code/utils.py index 28a5ef3c..ecfff4fb 100644 --- a/codegen/lib/code/utils.py +++ b/codegen/lib/code/utils.py @@ -1,4 +1,5 @@ +from lib.utils import get_dir_location import os # utilities specifically for codegen @@ -67,9 +68,9 @@ def burger_type_to_rust_type(burger_type): def write_packet_file(state, packet_name_snake_case, code): - with open(f'../azalea-protocol/src/packets/{state}/{packet_name_snake_case}.rs', 'w') as f: + with open(get_dir_location(f'../azalea-protocol/src/packets/{state}/{packet_name_snake_case}.rs'), 'w') as f: f.write(code) def fmt(): - os.system('cd .. && cargo fmt') + os.system(f'cd {get_dir_location("..")} && cargo fmt') |
