Commit e11d0308 authored by Robert Ricci's avatar Robert Ricci

Allow a filename to be passed rather than project and profile args

This is a wonderful display of my total lack of skill with sed
parent 9a040bbf
......@@ -2,8 +2,17 @@
BASEURL="https://www.cloudlab.us/profile-source.php"
PROJECT=$1
PROFILE=$2
if [ $# -eq 2 ]; then
PROJECT=$1
PROFILE=$2
elif [ $# -eq 1 ]; then
SHORTSTRING=`echo $1 | sed s_code-samples/profile/__`
PROJECT=`echo $SHORTSTRING | sed s_/.*__`
PROFILE=`echo $SHORTSTRING | sed s_.*/__ | sed s_\.py__`
else
echo "Usage: $0 <project> <profile>"
exit 1
fi
URL="$BASEURL?project=$PROJECT&profile=$PROFILE"
DIR="code-samples/profile/$PROJECT"
......
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