diff --git a/lib/compass/commands/install_rails.rb b/lib/compass/commands/install_rails.rb index c5c21405..0f620456 100644 --- a/lib/compass/commands/install_rails.rb +++ b/lib/compass/commands/install_rails.rb @@ -4,7 +4,8 @@ module Compass module Commands class InstallRails < Base def initialize(working_directory, options) - super(working_directory, options) + wd = options[:project_name] ? File.join(working_directory, options.delete(:project_name)) : working_directory + super(wd, options) end def perform set_install_location diff --git a/lib/compass/exec.rb b/lib/compass/exec.rb index 69bdb84a..bf2308de 100644 --- a/lib/compass/exec.rb +++ b/lib/compass/exec.rb @@ -69,13 +69,17 @@ module Compass self.opts = OptionParser.new(&method(:set_opts)) self.opts.parse!(self.args) if ARGV.size > 0 - self.options[:project_name] = ARGV.shift + self.options[:project_name] = trim_trailing_separator(ARGV.shift) end self.options[:command] ||= self.options[:project_name] ? :create_project : :update_project self.options[:environment] ||= :production self.options[:framework] ||= :compass end - + + def trim_trailing_separator(path) + path[-1..-1] == File::SEPARATOR ? path[0..-2] : path + end + def set_opts(opts) opts.banner = <