diff --git a/source/tools/templatessorter/readme.txt b/source/tools/templatessorter/readme.txt new file mode 100644 index 0000000000..91602db50b --- /dev/null +++ b/source/tools/templatessorter/readme.txt @@ -0,0 +1,5 @@ +Templates sorting utility aimed to sort components (second level xml elements) in simulation templates in alphabetical order. + +Usage: +./templatessorter.sh path_to_folder_with_simulation_templates + diff --git a/source/tools/templatessorter/templatessorter.sh b/source/tools/templatessorter/templatessorter.sh new file mode 100644 index 0000000000..65f2e8d540 --- /dev/null +++ b/source/tools/templatessorter/templatessorter.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# check arguments count +if [ $# -ne 1 ]; then + echo 'usage: '$0' directory' + exit +fi +# assign arguments to variables with readable names +input_directory=$1 +# perform work +find $input_directory -name \*.xml -exec xsltproc -o {} templatessorter.xsl {} \; + diff --git a/source/tools/templatessorter/templatessorter.xsl b/source/tools/templatessorter/templatessorter.xsl new file mode 100644 index 0000000000..f67548a911 --- /dev/null +++ b/source/tools/templatessorter/templatessorter.xsl @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + +