aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib/code/utils.py
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-06-17 16:27:58 -0500
committermat <github@matdoes.dev>2022-06-17 16:27:58 -0500
commitd0fc7d0eff32687d7210b730584db2c3faa055ae (patch)
tree8cbc9930a045d12c4eedd2b5af815f7c795f34d2 /codegen/lib/code/utils.py
parent69e1125ecbb3e695125b8e65deba3e3f7be41b70 (diff)
downloadazalea-drasl-d0fc7d0eff32687d7210b730584db2c3faa055ae.tar.xz
ClientboundSetEquipmentPacket
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')