diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2016-02-21 12:16:11 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2016-02-21 12:16:36 +0100 |
commit | d27b83d4bd5643ac42666735e8df8a8059d31aca (patch) | |
tree | b2eb28137dce8b973b0507a6b5f5b5cc2e71756a | |
parent | 0d6daec11f1663db8949e737619e6900e2bef277 (diff) | |
download | redot-engine-d27b83d4bd5643ac42666735e8df8a8059d31aca.tar.gz |
Add a script to sort demos alphabetically
By changing their timestamp, which Godot current relies on.
-rw-r--r-- | tools/scripts/sort-demos.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/scripts/sort-demos.sh b/tools/scripts/sort-demos.sh new file mode 100644 index 0000000000..d4770b337e --- /dev/null +++ b/tools/scripts/sort-demos.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# When scanning for demos, the project manager sorts them based on their +# timestamp, i.e. last modification date. This can make for a pretty +# messy output, so this script 'touches' each engine.cfg file in reverse +# alphabetical order to ensure a nice listing. +# +# It's good practice to run it once before packaging demos on the build +# server. + +if [ ! -d "demos" ]; then + echo "Run this script from the root directory where 'demos/' is contained." + exit 1 +fi + +if [ -e demos.list ]; then + rm -f demos.list +fi + +for dir in 2d 3d gui misc viewport; do + find "demos/$dir" -name "engine.cfg" |sort >> demos.list +done +cat demos.list |sort -r > demos_r.list + +while read line; do + touch $line + sleep 0.2 +done < demos_r.list + +#rm -f demos.list demos_r.list |