aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-25 22:18:52 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-25 22:18:52 +0000
commite2a2153c93f66dbad64d8986d07d8e431cba241d (patch)
tree20250b814e127f00df69af5ae4a9c1398fcb3715
parent98fcea216250c2cc3882f45799d7d1d7bebf0a8b (diff)
Make the load-sample-data script actually work
-rwxr-xr-xscript/load-sample-data12
1 files changed, 10 insertions, 2 deletions
diff --git a/script/load-sample-data b/script/load-sample-data
index 0521ef849..84b8a28eb 100755
--- a/script/load-sample-data
+++ b/script/load-sample-data
@@ -6,7 +6,15 @@
LOC=`dirname $0`
rake --silent spec:db:fixtures:load
-"$LOC/runner" 'puts File.expand_path(File.dirname(__FILE__) + "/spec/spec_helper"); require File.expand_path(File.dirname(__FILE__) + "/spec/spec_helper"); RawEmail.all().each {|email| email.data = load_file_fixture("useless_raw_email.email")}'
+"$LOC/runner" /dev/stdin <<END
+env = ENV["RAILS_ENV"]
+require "spec/spec_helper.rb" # Sets RAILS_ENV to 'test'
+ENV["RAILS_ENV"] = env
+RawEmail.all().each do |email|
+ puts "Writing #{email.filepath}"
+ email.data = load_file_fixture("useless_raw_email.email")
+end
+END
-echo "Loaded fixtures." \ No newline at end of file
+echo "Loaded fixtures."