aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib/code/utils.py
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-06-17 23:10:54 +0000
committerGitHub <noreply@github.com>2022-06-17 23:10:54 +0000
commitf414aa4d37e0c6a7adf55b772fa93714be6e9c9c (patch)
tree8cfb7d33114b9537b50477d5d6980995eec6cc5c /codegen/lib/code/utils.py
parent56f98c1b243d1ba8906ac73a2f2d8eec5646183e (diff)
parent0a945e73ec43b3b0389e004e138c83f41cddc532 (diff)
downloadazalea-drasl-f414aa4d37e0c6a7adf55b772fa93714be6e9c9c.tar.xz
Merge pull request #9 from mat-1/azalea-block
azalea-block
Diffstat (limited to 'codegen/lib/code/utils.py')
-rw-r--r--codegen/lib/code/utils.py5
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')