瀏覽代碼

Make `make_header.py` functional when run from any location

This removes the need to `cd` to `scene/resources/default_theme/`
to get the expected result.
Hugo Locurcio 6 年之前
父節點
當前提交
31eb116d49
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      scene/resources/default_theme/make_header.py

+ 5 - 0
scene/resources/default_theme/make_header.py

@@ -1,9 +1,14 @@
 #!/usr/bin/env python
 
 import glob
+import os
 
 enc = "utf-8"
 
+# Change to the directory where the script is located,
+# so that the script can be run from any location
+os.chdir(os.path.dirname(os.path.realpath(__file__)))
+
 # Generate include files
 
 f = open("theme_data.h", "wb")