script to quickly generate a mobile archive of a bunch of .geo files

parent 09be8c34
Pipeline #155 passed with stage
in 9 minutes 23 seconds
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: $0 file1.geo file2.geo ..." 1>&2;
exit 1;
fi
files=$*
rm -rf Archive
mkdir Archive
cp *.step Archive/
cat <<EOT >> Archive/infos.xml
<?xml version="1.0" encoding="utf-8"?>
<models>
EOT
for file in $files ; do
cp $file Archive/
echo "<model>" >> Archive/infos.xml
echo "<title>$file</title>" >> Archive/infos.xml
echo "<summary>$file</summary>" >> Archive/infos.xml
echo "<file type=\"geo\">$file</file>" >> Archive/infos.xml
echo "</model>" >> Archive/infos.xml
cat <<EOT > Archive/${file%.geo}.pro
DefineConstant[
R_ = {"", Name "GetDP/1ResolutionChoices", Visible 0},
C_ = {"", Name "GetDP/9ComputeCommand", Visible 0},
P_ = {"", Name "GetDP/2PostOperationChoices", Visible 0}
];
EOT
done
cat <<EOT >> Archive/infos.xml
</models>
EOT
zip -r Archive.zip Archive
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment