Commit e49bc2bc authored by Houtan Bastani's avatar Houtan Bastani

add size info to download page

parent 7feb23ba
......@@ -20,6 +20,7 @@ do
do
readarray -t filenames < <(jq .[].filename "$dir.json")
readarray -t timestamps < <(jq .[].date "$dir.json")
readarray -t size < <(jq .[].size "$dir.json")
n=$(jq length "$dir.json")
includeFilename="download-$branch-$dir.html"
echo "" > "$includeFilename"
......@@ -27,6 +28,7 @@ do
do
filename="${filenames[i]%\"}"
filename="${filename#\"}"
mb=$((size[i] / (10 ** 6)))
if [ "$branch" = "release" ]; then
IFS='-' read -ra split <<< "$filename"
if [ "$dir" = "windows" ] || [ "$dir" = "windows-zip" ]; then
......@@ -41,7 +43,7 @@ do
echo "{% assign dynare_stable_version = \"$version\" %}" > ../dynare_stable_version.md
fi
{
echo "<a href=\"https://www.dynare.org/$branch/$dir/$filename\">Dynare $version ($ext)</a>"
echo "<a href=\"https://www.dynare.org/$branch/$dir/$filename\">Dynare $version ($ext) ($mb MB)</a>"
echo "<a href=\"https://www.dynare.org/$branch/$dir/$filename.sig\">[signature]</a>"
} >> "$includeFilename"
else
......@@ -54,7 +56,7 @@ do
fi
{
echo "<div class=\"download_row\" onclick=\"document.location = 'https://www.dynare.org/$branch/$dir/$filename'\" onkeypress=\"document.location = 'https://www.dynare.org/$branch/$dir/$filename'\">"
echo " <div class=\"download_cell_left\"><i class=\"fas fa-file-download\"></i>&nbsp;$datestr</div>"
echo " <div class=\"download_cell_left\"><i class=\"fas fa-file-download\"></i>&nbsp;$datestr ($mb MB)</div>"
echo " <div class=\"download_cell_right\"><a href=\"#\">$filename</a></div>"
echo "</div>"
} >> "$includeFilename"
......
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 to comment