Use FuleUtils.mkdir_p for cleaner code

This commit is contained in:
J Phani Mahesh 2013-07-09 22:26:27 +05:30
parent 4fe6bee83c
commit b1fcd523c6

View File

@ -45,10 +45,8 @@ Bluepill.application("discourse", :base_dir => ENV["HOME"] + '/.bluepill') do |a
app.uid = user
app.working_dir = rails_root
tmpdir = "#{rails_root}/tmp"
sockdir = "#{tmpdir}/sockets"
File.directory? tmpdir or Dir.mkdir tmpdir
File.directory? sockdir or Dir.mkdir sockdir
sockdir = "#{rails_root}/tmp/sockets"
File.directory? sockdir or FileUtils.mkdir_p sockdir
num_webs.times do |i|
app.process("thin-#{i}") do |process|
process.start_command = "bundle exec thin start -e production -t 0 --socket #{sockdir}/thin.#{i}.sock --pid #{rails_root}/tmp/pids/thin#{i}.pid --log #{rails_root}/log/thin-#{i}.log --daemonize"