Skip to content

Commit

Permalink
- Fixed debug task to fail more gracefully when page not found. (keja…
Browse files Browse the repository at this point in the history
…dlen)

[git-p4: depot-paths = "//src/ZenWeb/dev/": change = 12402]
  • Loading branch information
zenspider committed Nov 9, 2019
1 parent d057cd5 commit b7625c9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/zenweb/tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,20 @@ end

website if ENV['DEBUG']

desc "Debug the generation of a file. Takes a PATH arg."
task :debug => ".site" do
desc "Debug the generation of a file. Takes a PAGE/F/FILE arg or defaults to index.html.erb."
task :debug do
site = website

path = ENV['PAGE'] || ENV['F'] || ENV['FILE'] || "index.html.erb"

if path then
page = site.pages[path]
page = site.pages[path]

if page
page.generate

puts
puts File.read page.url_path
else
fail "Could not find %p" % [path]
end
end

0 comments on commit b7625c9

Please sign in to comment.