Browse Source

Merge pull request #30753 from Calinou/make-header-run-from-any-location

Make `make_header.py` functional when run from any location
Rémi Verschelde 6 years ago
parent
commit
d8d85762c4
1 changed files with 5 additions and 0 deletions
  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
 #!/usr/bin/env python
 
 
 import glob
 import glob
+import os
 
 
 enc = "utf-8"
 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
 # Generate include files
 
 
 f = open("theme_data.h", "wb")
 f = open("theme_data.h", "wb")