Skip to content

Commit

Permalink
Set umask to world readable before generating site
Browse files Browse the repository at this point in the history
Ensure that calls to Jekyll and Compass force the umask for
those processes to be 022.  This ensures that any files in public/
will be world-readable, which is particularly important for anyone
with stricter umasks (e.g., the paranoid 077) using rsync for deploy.

This fixes #307.

Signed-off-by: Emil Sit <sit@emilsit.net>
  • Loading branch information
sit committed Dec 7, 2011
1 parent 19325e8 commit 8463f9a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ desc "Generate jekyll site"
task :generate do
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
puts "## Generating Site with Jekyll"
File.umask(022)
system "compass compile --css-dir #{source_dir}/stylesheets"
system "jekyll"
end
Expand All @@ -59,8 +60,8 @@ task :watch do
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
puts "Starting to watch source with Jekyll and Compass."
system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")
jekyllPid = Process.spawn("jekyll --auto")
compassPid = Process.spawn("compass watch")
jekyllPid = Process.spawn("jekyll --auto", :umask=>022)
compassPid = Process.spawn("compass watch", :umask=>022)

trap("INT") {
[jekyllPid, compassPid].each { |pid| Process.kill(9, pid) rescue Errno::ESRCH }
Expand All @@ -75,8 +76,8 @@ task :preview do
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
puts "Starting to watch source with Jekyll and Compass. Starting Rack on port #{server_port}"
system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")
jekyllPid = Process.spawn("jekyll --auto")
compassPid = Process.spawn("compass watch")
jekyllPid = Process.spawn("jekyll --auto", :umask=>022)
compassPid = Process.spawn("compass watch", :umask=>022)
rackupPid = Process.spawn("rackup --port #{server_port}")

trap("INT") {
Expand Down

0 comments on commit 8463f9a

Please sign in to comment.