-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompileSubjectCache.sh
More file actions
executable file
·32 lines (25 loc) · 1012 Bytes
/
compileSubjectCache.sh
File metadata and controls
executable file
·32 lines (25 loc) · 1012 Bytes
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
#!/bin/bash
# This script
# 1. cleans the temporary librarian data into finalized librarian data by removing
# personal widget styling and applying uniform dashboard styles
# 2. updates the subject caches using the Librarian, Database, and Guide info
#
# Use:
# 1. Usually, this script will be run by the ./getData script when refreshing
# data from the LibGuides API
# 2. The script may be run on its own for dev purposes, but that is not likely to
# be needed in the production environment
# after getting librarians (cache/LibrariansTemp), clean up the widgets
node ./utilities/runCleanCache > ./cache/Librarians.js
# delete subject cache files
rm ./cache/subjects/*.json
# populate subjects cache
node ./utilities/updateSubjectCache
# copy custom subjects to subject cache
if [[ $(find ./cache/custom/ -name '*.json' | wc -l) -gt 0 ]]
then
cp ./cache/custom/*.json ./cache/subjects
fi
# delete and populate tagged guide cache
rm ./cache/taggedGuides/*
node ./utilities/updateTaggedGuides