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

OSX doesn't install to path #36

Closed
spuder opened this issue Apr 2, 2018 · 19 comments
Closed

OSX doesn't install to path #36

spuder opened this issue Apr 2, 2018 · 19 comments
Labels
bug 🐛 Something isn't working macOS 🍎 Issues related to macOS

Comments

@spuder
Copy link

spuder commented Apr 2, 2018

brew install goto

Close all terminal windows, and reopen

goto
-bash: goto: command not found

I've tried brew unlink goto; brew link goto, and uninstalled and reinstalled,

ll /usr/local/Cellar/goto/1.2.3/etc/bash_completion.d/goto.sh
-rw-r--r--  1 sowen  admin  11402 Mar 14 13:47 /usr/local/Cellar/goto/1.2.3/etc/bash_completion.d/goto.sh

I've also tried

chmod +x /usr/local/Cellar/goto/1.2.3/etc/bash_completion.d/goto.sh

Something is still wrong with the brew package for goto on OSX

@iridakos iridakos added bug 🐛 Something isn't working macOS 🍎 Issues related to macOS working on 🚧 labels Apr 2, 2018
@iridakos
Copy link
Owner

iridakos commented Apr 2, 2018

Hi @spuder , thank you for reporting this.

The problem is that the formula depends on the bash-completion formula (read here for more information).

For now, you can install the missing formula with:

brew install bash-completion

I will update the README file to note this dependency until I update the formula to require this.

@iridakos
Copy link
Owner

iridakos commented Apr 2, 2018

@spuder can you please try installing the missing formula and let me know if all good? Thank you!

iridakos added a commit that referenced this issue Apr 2, 2018
@spuder
Copy link
Author

spuder commented Apr 2, 2018

I've tried installing bash-completion and also followed the instructions of that package

brew install bash-completion
echo '[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion' >> ~/.bash_profile

Then I open a new bash terminal, but goto still isn't in part of the path.

@thib-rdr
Copy link

thib-rdr commented Apr 3, 2018

Same for me, even after installing bash_completion, I got the same error message.

@iridakos
Copy link
Owner

iridakos commented Apr 3, 2018

Unfortunately I still can't reproduce it on my machine.

@thib-rdr
Copy link

thib-rdr commented Apr 4, 2018

If that can help, I know have this error each time I open a new terminal :

/usr/local/etc/bash_completion:59: command not found: shopt /usr/local/etc/bash_completion:65: command not found: complete /usr/local/etc/bash_completion:72: command not found: complete /usr/local/etc/bash_completion:73: command not found: complete /usr/local/etc/bash_completion:74: command not found: complete /usr/local/etc/bash_completion:76: command not found: complete /usr/local/etc/bash_completion:77: command not found: complete /usr/local/etc/bash_completion:79: command not found: complete /usr/local/etc/bash_completion:80: command not found: complete /usr/local/etc/bash_completion:81: command not found: complete /usr/local/etc/bash_completion:82: command not found: complete /usr/local/etc/bash_completion:83: command not found: complete /usr/local/etc/bash_completion:84: command not found: complete /usr/local/etc/bash_completion:85: command not found: complete /usr/local/etc/bash_completion:86: command not found: complete /usr/local/etc/bash_completion:87: command not found: complete /usr/local/etc/bash_completion:88: command not found: complete /usr/local/etc/bash_completion:89: command not found: complete /usr/local/etc/bash_completion:90: command not found: complete /usr/local/etc/bash_completion:91: command not found: complete /usr/local/etc/bash_completion:92: command not found: complete /usr/local/etc/bash_completion:93: command not found: complete /usr/local/etc/bash_completion:94: command not found: complete /usr/local/etc/bash_completion:95: command not found: complete /usr/local/etc/bash_completion:96: command not found: complete /usr/local/etc/bash_completion:97: command not found: complete /usr/local/etc/bash_completion:98: command not found: complete /usr/local/etc/bash_completion:99: command not found: complete /usr/local/etc/bash_completion:100: command not found: complete /usr/local/etc/bash_completion:101: command not found: complete /usr/local/etc/bash_completion:102: command not found: complete /usr/local/etc/bash_completion:103: command not found: complete /usr/local/etc/bash_completion:104: command not found: complete /usr/local/etc/bash_completion:105: command not found: complete /usr/local/etc/bash_completion:106: command not found: complete /usr/local/etc/bash_completion:107: command not found: complete /usr/local/etc/bash_completion:108: command not found: complete /usr/local/etc/bash_completion:110: command not found: complete /usr/local/etc/bash_completion:111: command not found: complete /usr/local/etc/bash_completion:112: command not found: complete /usr/local/etc/bash_completion:113: command not found: complete /usr/local/etc/bash_completion:114: command not found: complete /usr/local/etc/bash_completion:115: command not found: complete /usr/local/etc/bash_completion:116: command not found: complete /usr/local/etc/bash_completion:117: command not found: complete /usr/local/etc/bash_completion:118: command not found: complete /usr/local/etc/bash_completion:119: command not found: complete /usr/local/etc/bash_completion:120: command not found: complete /usr/local/etc/bash_completion:121: command not found: complete /usr/local/etc/bash_completion:122: command not found: complete /usr/local/etc/bash_completion:123: command not found: complete /usr/local/etc/bash_completion:124: command not found: complete /usr/local/etc/bash_completion:125: command not found: complete /usr/local/etc/bash_completion:126: command not found: complete /usr/local/etc/bash_completion:132: command not found: complete /usr/local/etc/bash_completion:135: command not found: complete /usr/local/etc/bash_completion:138: command not found: complete /usr/local/etc/bash_completion:141: command not found: complete /usr/local/etc/bash_completion:144: command not found: complete /usr/local/etc/bash_completion:147: command not found: complete /usr/local/etc/bash_completion:150: command not found: complete /usr/local/etc/bash_completion:153: command not found: complete /usr/local/etc/bash_completion:156: command not found: complete /usr/local/etc/bash_completion:159: command not found: complete /usr/local/etc/bash_completion:162: command not found: complete /usr/local/etc/bash_completion:341: parse error near \n'`

@iridakos
Copy link
Owner

iridakos commented Apr 4, 2018

@thib-rdr Is there any case you are in zsh shell instead of bash?

@thib-rdr
Copy link

thib-rdr commented Apr 5, 2018

@iridakos Yes, I am using Oh My ZSH.

@mingrammer
Copy link

I have same problem. I'm using ZSH too.

@EdKeith
Copy link

EdKeith commented Jun 18, 2018

I am also having this problem using bash.

@iridakos
Copy link
Owner

@thib-rdr @mingrammer Sorry for the delayed response. Unfortunately, I can't test the script on MacOS' zsh any time soon. The script is only available for the bash shell on MacOS at the moment.

@iridakos
Copy link
Owner

@EdKeith Hello, thanks for reporting. Are you on bash or zsh shell?

@JBlond
Copy link
Contributor

JBlond commented Jan 21, 2019

ZSH uses setopt not shopt an option might be https://github.com/larz258/Zshopt/blob/master/shopt

@iridakos
Copy link
Owner

Closing due to inactivity.

@nurseiit
Copy link

I have looked into this a little.

To me, it seems like to be able to install via brew one needs to change the structure of goto repo.

Installation process is different in a sense that simply putting the goto.sh to path is not enough. Because the way it's implemented right now is a set of global functions that need to be source-d via .bash_profile or so every time you open a terminal session.

There might be some other ways to support doing just that via brew – I'm not sure.

I would love to try update the structure, though I'm afraid to break some other things in the process. We'll need to implement tests to avoid that.

@BellaTrix25336
Copy link

I am using bash on MacOs and I struggled a lot to get bash-completion activated as well as getting goto to work, seeing the same command not found error. Finally, I found this solution:

. /usr/local/etc/bash-completion.d/goto.sh

So I added this line to .bashrc (or .bash_profile in my case):

[[ $PS1 && -f /usr/local/etc/bash_completion.d/goto.sh ]] && \
    . /usr/local/etc/bash_completion.d/goto.sh

And now both goto and autocompletion are working fine.

@emirlej
Copy link

emirlej commented Aug 7, 2019

Great, @BellaTrix25336. That worked great. I'm using MacOS and zsh 😄 .

Maybe you could mention this in the repo, @iridakos 👍 ?

@JDW818
Copy link

JDW818 commented Aug 14, 2019

@BellaTrix25336 thanks! This worked for me as well.

@dcchambers
Copy link

In addition to the fix from @BellaTrix25336, a slightly cleaner fix is to add this to your bash_profile:

source $(brew --prefix)/etc/bash_completion.d/goto.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working macOS 🍎 Issues related to macOS
Projects
None yet
Development

No branches or pull requests