Skip to content

Commit ce7822a

Browse files
authored
fix: Make the build_shader script work for windows (#3402)
Windows needed some love
1 parent 9c416cb commit ce7822a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/flame_3d/bin/build_shaders.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,25 @@ Future<void> compute(Directory assets, Directory shaders) async {
4141
final uniqueShaders = shaders
4242
.listSync()
4343
.whereType<File>()
44-
.map((f) => f.path.split('/').last.split('.').first)
44+
.map((f) => f.path.split(Platform.pathSeparator).last.split('.').first)
4545
.toSet();
4646

4747
for (final name in uniqueShaders) {
4848
final bundle = {
4949
'TextureFragment': {
5050
'type': 'fragment',
51-
'file': '${shaders.path}/$name.frag',
51+
'file': '${shaders.path}${Platform.pathSeparator}$name.frag',
5252
},
5353
'TextureVertex': {
5454
'type': 'vertex',
55-
'file': '${shaders.path}/$name.vert',
55+
'file': '${shaders.path}${Platform.pathSeparator}$name.vert',
5656
},
5757
};
5858

5959
stdout.writeln('Computing shader "$name"');
6060
final impellerC = await findImpellerC();
6161
final result = await Process.run(impellerC.toFilePath(), [
62-
'--sl=${assets.path}/$name.shaderbundle',
62+
'--sl=${assets.path}${Platform.pathSeparator}$name.shaderbundle',
6363
'--shader-bundle=${jsonEncode(bundle)}',
6464
]);
6565

0 commit comments

Comments
 (0)