Class | Webgen::CLI::CreateCommand |
In: |
lib/webgen/cli/create_command.rb
|
Parent: | CmdParse::Command |
Create a webgen website in the directory args[0].
# File lib/webgen/cli/create_command.rb, line 47 47: def execute(args) 48: if args.length == 0 49: raise OptionParser::MissingArgument.new('DIR') 50: else 51: wm = Webgen::WebsiteManager.new(args[0]) 52: paths = wm.create_website 53: begin 54: if @bundles 55: @bundles = ['default', 'simple'] if @bundles.empty? 56: @bundles.each {|name| paths += wm.apply_bundle(Utils.match_bundle_name(wm, name)) } 57: end 58: rescue 59: require 'fileutils' 60: FileUtils.rm_rf(args[0]) 61: raise 62: end 63: if commandparser.verbosity == :verbose 64: puts "The following files were created in the directory #{args[0]}:" 65: puts paths.sort.join("\n") 66: end 67: end 68: end