Commit 2372d1a8 authored by Richard Torenvliet's avatar Richard Torenvliet

update readme and upload gitigore

parent a6a090df
*.sw[a-zA-Z]
## Extract assignments
## Why is it needed
This bash script is created to extract files from blackboard. Blackboard has a
horrible way of creating a zipfile. This tries to fix it.
## Usage
This bash script is used to unpack the zipfile blackboard generates when
you download all the files in the "full grade center" -> Assignment Download
File -> select all students -> download zipfile. Use help functionality to
guide you to use this bash script.
The following output is generated when you call the script with -h.
~~~
Help documentation for bb_extract.
Basic usage: bb_extract gradebook.zip
Command line switches are optional. The following switches are recognized.
-d --Set output directory. /tmp/bb_cleaned.
-h --Displays this help message. No further functions are performed.
Example: bb_extract -d assignment1 gradebook.zip
~~~
## advise
Clone this repo into your ~/.config directory and add it to your the path into
your `$PATH` env variable for maximum convenience.
## References
This guy helped me in making the bashscript useable for other people:
http://tuxtweaks.com/2014/05/bash-getopts/
......
......@@ -23,12 +23,12 @@
# default extract directory
BB_EXTRACT_DIR=/tmp/blackboard
#Set Script Name variable
SCRIPT=`basename ${BASH_SOURCE[0]}`
#Initialize variables to default values.
OUTPUT_DIR=/tmp/bb_cleaned
#Set Script Name variable
SCRIPT=`basename ${BASH_SOURCE[0]}`
#Set fonts for Help.
NORM=`tput sgr0`
BOLD=`tput bold`
......@@ -50,8 +50,7 @@ function extract() {
*) echo "'$ARCHIVE' cannot be extracted via >extract<" && exit 1;;
esac
else
echo "'$ARCHIVE' is not a valid file $OUTPUT"
exit 1
echo "'$ARCHIVE' is not a valid file $OUTPUT, continueing"
fi
}
......@@ -89,8 +88,7 @@ function find_and_unpack() {
cp $PDF_LIST $SUBMIT_NAME
done
if [ -z $ARCHIVE_LIST ]; then
echo $SUBMIT_NAME >> "error.txt"
if [ -z $ARCHIVE_LIST ]; then echo $SUBMIT_NAME >> "error.txt"
else
for ARCHIVE in $ARCHIVE_LIST; do
extract $ARCHIVE $SUBMIT_NAME
......
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