Skip to content

Commit

Permalink
add verifiers for tutorial build step
Browse files Browse the repository at this point in the history
  • Loading branch information
arlimus committed Sep 28, 2016
1 parent 695680a commit 9a816b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tasks/shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,14 @@ def self.info(msg)
puts "\033[32;1m----> #{msg}\033[0m"
end
end

module Verify
def self.file(path)
return print("\033[32m.\033[0m") if File.file?(path)
fail "Failed to build this step. Looking for file in #{path} but it doesn't exist."
end

def self.ok
puts "\n\033[32mAll build checks passed.\033[0m"
end
end
4 changes: 4 additions & 0 deletions tasks/www.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
Log.section 'Build the online tutorial in www/tutorial/'
sh('cd www/tutorial/ && npm install')
sh('cd www/tutorial/ && gulp build')
Verify.file('www/tutorial/dist/index.html')
Verify.file('www/tutorial/dist/css/inspec_tutorial.css')
Verify.file('www/tutorial/dist/scripts/inspec_tutorial.js')
Verify.file('www/tutorial/dist/dist/inspec_tutorial.js')
end

desc 'Builds the middleman site'
Expand Down

0 comments on commit 9a816b2

Please sign in to comment.