Skip to content

Commit d96d688

Browse files
author
Christopher - Marcel Böddecker
committed
fix(templates): support spaces in file path in Unity .meta checks
1 parent e0207f8 commit d96d688

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

templates/steps/cd.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,45 @@ steps:
99
tarball=$(find . -name "*.tgz")
1010
tarballFilePaths=$(tar -tf $tarball)
1111
12-
for filePath in $tarballFilePaths
12+
while read -r filePath
1313
do
1414
case $filePath in
1515
*.meta)
1616
metaFilePath=$filePath
1717
found=false
1818
regularFilePath=${metaFilePath%.meta}
19-
for otherFilePath in $tarballFilePaths
19+
while read -r otherFilePath
2020
do
2121
case $otherFilePath in
2222
$regularFilePath/* | $regularFilePath*) # folder or file
23-
if [ $metaFilePath != $otherFilePath ]
23+
if [ "$metaFilePath" != "$otherFilePath" ]
2424
then
2525
found=true
2626
break
2727
fi;;
2828
esac
29-
done
29+
done <<< "$tarballFilePaths"
3030
if [ "$found" = false ]
3131
then
32-
echo "Missing file for Unity meta file '$metaFilePath'." >&2
32+
echo "Missing file for Unity meta file '${metaFilePath#"package/"}'." >&2
3333
fi;;
34-
esac
35-
done
36-
37-
for filePath in $tarballFilePaths
38-
do
39-
case $filePath in
40-
*.meta)
41-
;;
4234
*)
4335
regularFilePath=$filePath
4436
found=false
45-
for otherFilePath in $tarballFilePaths
37+
while read -r otherFilePath
4638
do
4739
case $otherFilePath in
4840
$regularFilePath.meta)
4941
found=true
5042
break;;
5143
esac
52-
done
44+
done <<< "$tarballFilePaths"
5345
if [ "$found" = false ]
5446
then
55-
echo "Missing Unity meta file for file '$regularFilePath'." >&2
47+
echo "Missing Unity meta file for file '${regularFilePath#"package/"}'." >&2
5648
fi;;
5749
esac
58-
done
50+
done <<< "$tarballFilePaths"
5951
6052
rm -f $tarball
6153
displayName: Check Unity .meta files

0 commit comments

Comments
 (0)