This should work; I tried to condense the first 3 lines into a 1-liner but :

Shoes.app do
  @git_path = `which git`.strip
  @git_path = ask("I couldn't find git. Do you know where it is?") if
@git_path.empty?
  @git_path.gsub!(/\/git$/, '')

  @git_rev_list = "[EMAIL PROTECTED]/git-rev-list"

  stack do
    para "Your git-rev-list command is: [EMAIL PROTECTED]"
  end
end


-tieg

On Thu, Jul 17, 2008 at 3:23 AM, Joshua Ballanco <[EMAIL PROTECTED]> wrote:

> What am I doing wrong? This should work, yes? Also, I think I'm missing an
> easier way to check for the presence of git. Ideas?
>
> Shoes.app do
>  ENV['PATH'].split(':').reverse.each do |path|
>    cmd_with_path = "#{path}/git-rev-list"
>    if File.exists? cmd_with_path
>      @git_rev_list = cmd_with_path
>    end
>  end
>
>  if @git_rev_list.nil?
>    @git_rev_list = ask "I couldn't find git. Do you know where it is?"
>  end
>
>  stack do
>    para "Your git-rev-list command is: [EMAIL PROTECTED]"
>  end
> end
>
> Any/all help appreciated!
>
> Cheers,
>
> Josh
>

Reply via email to