-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.sh
executable file
·48 lines (30 loc) · 1.52 KB
/
configure.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# !/bin/bash
# Create the file, set_env.sh, so that the Canvas URL and token can be set as
# environment variables.
# Once set_env.sh has been created, this
# script will not be needed any longer. Instead, when opening a terminal for the first, only 'source ./set_env.sh' will need to be called.
SETENV="set_env.sh"
if [[ -e "$SETENV" ]]; then
echo "set_env.sh already exists (delete it if you wish to create it again, or modify it directly)"
exit
fi
echo " ========== Creating configuration script: $SETENV ========== "
echo "Enter the URL of your Canvas LMS (oftentimes this is of the form, your_institution_name.instructure.com):"
read LMSURL
echo "Enter or paste your Canvas LMS access token here (be careful not to share this with anyone else):"
read TOKEN
echo "#!/bin/bash" > "$SETENV"
echo "export CANVAS_URL=\"$LMSURL\"" >> "$SETENV"
echo "export CANVAS_TOKEN=\"$TOKEN\"" >> "$SETENV"
# Set the execute permission for the configuration script
chmod +x "$SETENV"
DATA="data"
EXCSV="present_example.csv"
FIGS="figures"
echo "\n =========== Creating subdirectories: $DATA, $FIGS =========== "
mkdir -p $DATA $FIGS
# Create the sample .csv file with specific column names in the data/ subdirectory
echo "last_name_first_name,name,id,sis_id,email,present" > $DATA/$EXCSV
echo "\"Doe, Jane\",Jane Doe,12345,987654321,[email protected],1 " >> $DATA/$EXCSV
echo "\"Doe, John\",John Doe,12346,987654322,[email protected],1 " >> $DATA/$EXCSV
echo "\"Doe, Jim\",Jim Doe,12347,987654323,[email protected],0 " >> $DATA/$EXCSV