#!/usr/bin/env ruby require File.expand_path('../../lib/guinness', __FILE__) cmd = ARGV[0] || 'drink' dir = ARGV[1] || '_source' puts "#{Guinness::EMOJI} Guinness : App root is: '#{dir}'" case cmd when 'new' require 'fileutils' File.open(File.join(FileUtils.mkpath(dir), 'index.html'), 'w') do |f| f.puts 'Cheers from Guinness!' end when 'build', 'drink' abort "#{Guinness::EMOJI} Guinness : Unable to locate: '#{dir}'" unless Dir.exists?(dir) @app = Guinness::Application.new(root: dir) @app.send cmd else puts "'#{cmd}' is not a valid guinness command" puts 'Usage: guinness (build,drink,new) ' end