Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors using agnoster if svn isn't present #3

Closed
MarkHerhold opened this issue Jul 20, 2015 · 7 comments
Closed

Errors using agnoster if svn isn't present #3

MarkHerhold opened this issue Jul 20, 2015 · 7 comments

Comments

@MarkHerhold
Copy link

It appears that agnoster is looking to see if svn is installed but is causing an error in the process. Perhaps which svn might be a better match for this check?

System: Ubuntu 14.04 x64

/home/mark/.oh-my-fish/themes/agnoster/fish_prompt.fish (line 129):   if command svn ls . >/dev/null 2>&1
                                                                                 ^
in function “prompt_svn”,
    called on line 180 of file “/home/mark/.oh-my-fish/themes/agnoster/fish_prompt.fish”,

in function “fish_prompt”,
    called on standard input,

in command substitution
    called on standard input,

The program 'svn' is currently not installed. You can install it by typing:
sudo apt-get install subversion

I fixed the issue by installing subversion sudo apt-get install subversion but I feel like users shouldn't have to do that.

@bpinto
Copy link
Member

bpinto commented Jul 20, 2015

Agreed. Could you submit a PR?

@MarkHerhold
Copy link
Author

@bpinto Possibly. I'll have to request approval.

@FabioAntunes
Copy link
Contributor

I fixed this issue doing type svn, here's the function changed:

function prompt_svn -d "Display the current svn state"
  set -l ref
  if type svn >/dev/null 2>&1
    if command svn ls . >/dev/null 2>&1
      set branch (svn_get_branch)
      set branch_symbol \uE0A0
      set revision (svn_get_revision)
      prompt_segment green black "$branch_symbol $branch:$revision"
    end
  end
end

@bpinto
Copy link
Member

bpinto commented Jul 29, 2015

@FabioAntunes Nice! Could you merge both if scenarios with an and?

FabioAntunes added a commit to FabioAntunes/theme-agnoster that referenced this issue Jul 29, 2015
@FabioAntunes
Copy link
Contributor

@bpinto sure, here's the merge function:

function prompt_svn -d "Display the current svn state"
  set -l ref
  if type svn >/dev/null 2>&1; and command svn ls . >/dev/null 2>&1
    set branch (svn_get_branch)
    set branch_symbol \uE0A0
    set revision (svn_get_revision)
    prompt_segment green black "$branch_symbol $branch:$revision"
  end
end

@bpinto
Copy link
Member

bpinto commented Jul 29, 2015

Hey, would you submit as a PR? Sorry for the trouble!

@bpinto bpinto closed this as completed in bdec0be Jul 29, 2015
bpinto added a commit that referenced this issue Jul 29, 2015
Supressed warning when svn isn't installed. Fixes #3
@sn0cr
Copy link
Collaborator

sn0cr commented Aug 11, 2015

I'm sorry, but this PR creates the bug documented in PR #5 - it shows the svn branch symbol at any time (on OS X).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants