summaryrefslogtreecommitdiff
path: root/devfiles/scripts
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2013-09-03 07:02:59 -0700
committerJesse Morgan <jesse@jesterpm.net>2013-09-03 07:03:26 -0700
commiteb881fdc9b62d1b9d1f5c61f1f4077065db7e933 (patch)
tree85dda0e94824177ed5aed88d511b95071fe85d87 /devfiles/scripts
parent84d008be8a35d3a19607de669042ddb5c6540f0c (diff)
New account page improvements and renumbered questions.
Diffstat (limited to 'devfiles/scripts')
-rwxr-xr-xdevfiles/scripts/bootstrap-cassandra.sh6
-rwxr-xr-xdevfiles/scripts/compile-questions.sh17
2 files changed, 20 insertions, 3 deletions
diff --git a/devfiles/scripts/bootstrap-cassandra.sh b/devfiles/scripts/bootstrap-cassandra.sh
index e0813a0..128767e 100755
--- a/devfiles/scripts/bootstrap-cassandra.sh
+++ b/devfiles/scripts/bootstrap-cassandra.sh
@@ -12,13 +12,13 @@ $TOOLS/scripts/setup-cassandra.sh
# Bootstrap keyspace
TEMPFILE=`mktemp`
-cat $DEVFILES/cassandra-bootstrap.cql > $TEMPFILE
+cat $DEVFILES/scripts/cassandra-bootstrap.cql > $TEMPFILE
# Fill with questions
-./compile-questions.sh >> $TEMPFILE
+$DEVFILES/scripts/compile-questions.sh >> $TEMPFILE
# Fill with videos
-./compile-videos.sh >> $TEMPFILE
+$DEVFILES/scripts/compile-videos.sh >> $TEMPFILE
# GO!
#cat $TEMPFILE | less
diff --git a/devfiles/scripts/compile-questions.sh b/devfiles/scripts/compile-questions.sh
index 16be5b1..7f108b8 100755
--- a/devfiles/scripts/compile-questions.sh
+++ b/devfiles/scripts/compile-questions.sh
@@ -1,9 +1,26 @@
# Dump Cassandra commands to setup questions
+
+FIRST=""
+COUNT=0
+
for i in $DEVFILES/questions/*.json; do
id=`basename $i .json`
+ if [ -z "$FIRST" ]; then
+ FIRST=$id
+ fi
echo "set strings['/questions/${id}']['value'] = '"
cat $i
echo "';"
+ COUNT=$((COUNT + 1))
done
+# Create Summary
+cat << EOF
+set strings['/questions']['value'] = '
+{
+ "first": "$FIRST",
+ "count": $COUNT
+}
+';
+EOF