Commit e2d6dcd5 authored by Vinicius Ruoso's avatar Vinicius Ruoso

Fixed problems when generating pages not on current directory.

Before, if the TYPEDIR variable have '../' or absolute paths a bad name was
formated to fill the select box.

Now, we fixed it by using the TYPENAME variable and the basename of current
file.
Signed-off-by: default avatarVinicius Ruoso <vkr07@c3sl.ufpr.br>
parent e6ea4f0b
......@@ -9,21 +9,21 @@ main()
fi
for TYPE in $TYPEDIR/*; do
add_option single $TYPE
add_option single "$TYPENAME/$(basename $TYPE)"
done
sed "s/(PAGES)/${OPTIONS}/g" $BARHTML > $BARFILE
sed "s#(PAGES)#${OPTIONS}#g" $BARHTML > $BARFILE
}
function add_option()
{
if [ $1 == "sumary" ]; then
LOWER=$(echo $2 |tr '[:upper:]' '[:lower:]')
OPTIONS="${OPTIONS}<option value=\"${LOWER}.html\">$2<\/option>\n"
OPTIONS="${OPTIONS}<option value=\"${LOWER}.html\">$2</option>\n"
else
NAME=$(basename $2)
SHOW=$(echo $2 |sed -e "s#\/#\\\/#g" |tr '_' ' ')
OPTIONS="${OPTIONS}<option value=\"${NAME}\/\">${SHOW}<\/option>\n"
SHOW=$(echo $2 |tr '_' ' ')
OPTIONS="${OPTIONS}<option value=\"${NAME}/\">${SHOW}</option>\n"
fi
}
......
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