aboutsummaryrefslogtreecommitdiffstats
path: root/script/load-sample-data
blob: fc5cbeed12426f72a681d1381c66571a488eefc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

# This script loads spec fixtures, but also needs to do a hack around
# the fact that the fixtures aren't aware of the fact that RawEmails
# have a filesystem representation of their contents

LOC=`dirname "$0"`
bundle exec rake --silent spec:db:fixtures:load

"$LOC/runner" /dev/stdin <<END
env = ENV["RAILS_ENV"]
require "spec/spec_helper.rb" # this sets RAILS_ENV to 'test'
ENV["RAILS_ENV"] = env        # so restore to what it was before

load_raw_emails_data
END

echo "Loaded fixtures.  You may now wish to run $LOC/update-xapian-index"