Skip to content

Commit 58922e9

Browse files
committed
Sort shaders alphabetically
Apparently the results of Python's glob() aren't necessarily sorted on all platforms (e.g., Linux). Sort the shaders so that Git doesn't churn shaders.gen.js every time someone on a different platform commits changes.
1 parent dc82aaa commit 58922e9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

build_only_shaders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import re, os, subprocess
1212

1313
shader_file = ["Export({ shaders: {"]
14-
for fn in glob("shaders/*.shader"):
14+
for fn in sorted(glob("shaders/*.shader")):
1515
name = re.match(r"^shaders[/\\]([^.]+).shader$", fn).group(1)
1616
f = open(fn, "rt").read()
1717
shader_file.append( '"' + name + '":' + repr(f) + "," )

build_original.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import re, os, subprocess
2020

2121
shader_file = ["Export({ shaders: {"]
22-
for fn in glob("shaders/*.shader"):
22+
for fn in sorted(glob("shaders/*.shader")):
2323
name = re.match(r"^shaders[/\\]([^.]+).shader$", fn).group(1)
2424
f = open(fn, "rt").read()
2525
shader_file.append( '"' + name + '":' + repr(f) + "," )
@@ -90,7 +90,7 @@ def combine(inlibs):
9090
def minify(inlibs, inlibs_nomin, outlib):
9191
all = combine(inlibs)
9292
outf = open(outlib, "wb")
93-
93+
9494
if True: # minify if True
9595
uglify = subprocess.Popen( "build-tools/node.exe build-tools/Uglify-ES/uglify-es/bin/uglifyjs",
9696
stdin=subprocess.PIPE,

build_original_no_overload.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import re, os, subprocess
2626

2727
##shader_file = ["Export({ shaders: {"]
28-
##for fn in glob("shaders/*.shader"):
28+
##for fn in sorted(glob("shaders/*.shader")):
2929
## name = re.match(r"^shaders[/\\]([^.]+).shader$", fn).group(1)
3030
## f = open(fn, "rt").read()
3131
## shader_file.append( '"' + name + '":' + repr(f) + "," )
@@ -84,7 +84,7 @@ def combine(inlibs):
8484
def minify(inlibs, inlibs_nomin, outlib):
8585
all = combine(inlibs)
8686
outf = open(outlib, "wb")
87-
87+
8888
if True: # minify if True
8989
uglify = subprocess.Popen( "build-tools/node.exe build-tools/Uglify-ES/uglify-es/bin/uglifyjs",
9090
stdin=subprocess.PIPE,

0 commit comments

Comments
 (0)