smartcd icon indicating copy to clipboard operation
smartcd copied to clipboard

Feature request: Brew support

Open DarrenPIngram opened this issue 4 years ago • 14 comments

Could you consider adding this to the "brew" package manager? I don't know what work that would entail for you, but it could be appreciated if possible. I use Brew on the Mac and on a couple of Linux servers.

Thanks

DarrenPIngram avatar Dec 15 '21 10:12 DarrenPIngram

I am not sure as I never used brew package manager.. but I found this on brew's documentation page. Check if it works for you and let me know. In brief, what I understood, brew can also treat third party repositories like from Github also as a homebrew/core canonical repository. Its just that the repository name should have the prefix as homebrew. So, what you can try is - clone this repo, rename it (add homebrew- as prefix) & run brew tap DarrenPIngram/homebrew-smartcd.

CodesOfRishi avatar Dec 15 '21 13:12 CodesOfRishi

Thank you for the tip. That is appreciated. Now, maybe I am doing something obviously wrong, but I have installed via brew the cloned script both on MacOS and Debian 11, installed fzf and fd, restarted the shell AND a new terminal session and nothing seems to be happening (zshrc on Mac, bash on Debian). I've navigated around some directories but cd -- doesn't show anything, nor does any type-ahead occur.

It is probably something very obvious but I've looked at the documentation and see nothing to guide me !

DarrenPIngram avatar Dec 16 '21 08:12 DarrenPIngram

Have you sourced the smartcd.sh script in your .zshrc file (shell configuration file) ??

CodesOfRishi avatar Dec 16 '21 09:12 CodesOfRishi

Embarassing. Had assumed the package manager did that. Sorry I need more handholding.

Installed using defaults. Pointed the file in my .zshrc script file

Now on opening you get:

Last login: Fri Dec 17 10:31:57 on ttys003 You have mail. whereis: illegal option -- b usage: whereis program [...] whereis: illegal option -- b usage: whereis program [...] Can't use SmartCd: fzf not found ! whereis: illegal option -- b usage: whereis program [...] Can't use SmartCd: fd not found !

Yet fzf and fd are installed by brew and if you enter them on the command line they do their stuff...

DarrenPIngram avatar Dec 17 '21 08:12 DarrenPIngram

Ok no problem… I have done most of the things for you regarding the Homebrew package manager!! But still I wasn't able to configure each & everything as it should have been, I think, as Homebrew is relatively very new to me & I still need to know more about it.

STEPS

brew tap CodesOfRishi/smartcd
brew install smartcd # (this will also install the dependencies required)
which smartcd.sh # (to know path where smartcd.sh script is)
  • source the smartcd.sh script in your .zshrc or .bashrc file using the output that you got from which smartcd.sh command.
  • reload the shell
  • And, let me know how things goes!

CodesOfRishi avatar Dec 17 '21 10:12 CodesOfRishi

It gave the same errors. Also it seems brew doesn't have the dependency install feature. It complained about the #

source /usr/local/bin/smartcd.sh

is the path in my .zshrc file, as different to the original I had pointed to the scripts directory.

Same whereis: illegal option -- b

usage: whereis program [...]

whereis: illegal option -- b

usage: whereis program [...]

Can't use SmartCd: fzf not found !

whereis: illegal option -- b

usage: whereis program [...]

Can't use SmartCd: fd not found !

This is within the terminal of Mac OS 10.15.7 in case it makes a difference. I can't check presently on the Debian server but I will.

d

On Fri, 17 Dec 2021 at 12:03, Rishi K. @.***> wrote:

Ok no problem… I have done most of the things for you regarding the Homebrew package manager!! But still I wasn't able to configure each & everything as it should have been, I think, as Homebrew is relatively very new to me & I still need to know more about it.

STEPS

brew tap CodesOfRishi/smartcd

brew install smartcd # (this will also install the dependencies required)

which smartcd.sh # (to know path where smartcd.sh is)

  • source the smartcd.sh script in your .zshrc or .bashrc file using the output that you got from which smartcd.sh command.
  • reload the shell
  • And, let me know how things goes!

— Reply to this email directly, view it on GitHub https://github.com/CodesOfRishi/smartcd/issues/4#issuecomment-996589851, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABV5MAAGVJAL67H2L2JXBLDURMDIBANCNFSM5KDJSSIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

DarrenPIngram avatar Dec 17 '21 10:12 DarrenPIngram

You said you have fd installed & running... can you run & tell what output do you get on running fd -H -i smartcd from your /home directory? The error seems something regarding the whereis command. What output do you get when you just run whereis -b fzf and whereis -b fd?

CodesOfRishi avatar Dec 17 '21 10:12 CodesOfRishi

Appreciate your patience. Maybe this is some Mac or Homebrew issue.

@.*** ~ % fd -H -i smartcd

Library/Caches/Homebrew/smartcd--1.3.0.tar.gz

Library/Caches/Homebrew/downloads/ cd69e60c17e7a37209256ff7b499f43eb46819aa362da36cc6f2a39701f826eb--smartcd-1.3.0.tar.gz

Library/Logs/Homebrew/smartcd

@.*** ~ %

On Fri, 17 Dec 2021 at 12:18, Rishi K. @.***> wrote:

You said you have fd installed & running... can you run & tell what output do you get on running fd -H -i smartcd from your /home directory?

— Reply to this email directly, view it on GitHub https://github.com/CodesOfRishi/smartcd/issues/4#issuecomment-996602442, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABV5MABUKMGOLGIPCFC2EMLURME6VANCNFSM5KDJSSIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

DarrenPIngram avatar Dec 17 '21 10:12 DarrenPIngram

Ok can you anyhow undo/uninstall smartcd when you installed using the steps mentioned in this comment & install again using the steps mentioned here, because the latest one works on my Q4 OS debian machine !! My assumption is that there must be something conflict happening from your previous install!

CodesOfRishi avatar Dec 17 '21 10:12 CodesOfRishi

di@MacPro ~ % brew uninstall smartcd
Uninstalling /usr/local/Cellar/smartcd/1.3.0... (5 files, 17.5KB)
di@MacPro ~ % brew tap CodesOfRishi/smartcd
di@MacPro ~ % brew install smartcd # 
Warning: No available formula with the name "#".
==> Searching for similarly named formulae...
^C
di@MacPro ~ % brew install smartcd   
==> Downloading https://github.com/CodesOfRishi/smartcd/archive/refs/tags/v1.3.0.tar.gz
Already downloaded: /Users/di/Library/Caches/Homebrew/downloads/cd69e60c17e7a37209256ff7b499f43eb46819aa362da36cc6f2a39701f826eb--smartcd-1.3.0.tar.gz
==> Installing smartcd from codesofrishi/smartcd
🍺  /usr/local/Cellar/smartcd/1.3.0: 5 files, 17.5KB, built in 8 seconds
==> Running `brew cleanup smartcd`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
di@MacPro ~ % brew install fzf fd
Warning: fzf 0.28.0 is already installed and up-to-date.
To reinstall 0.28.0, run:
  brew reinstall fzf
Warning: fd 8.3.0 is already installed and up-to-date.
To reinstall 8.3.0, run:
  brew reinstall fd
di@MacPro ~ % which smartcd.sh 
/usr/local/bin/smartcd.sh
di@MacPro ~ % tail .zshrc
	# Interactively load a light theme
	alias thl='theme.sh --light -i'

	# Interactively load a dark theme
	alias thd='theme.sh --dark -i'
fi

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

source /usr/local/bin/smartcd.sh

Same error with MacOS terminal. It did not like the # after the brew command but I let it try and reinstall the dependencies of FZF and fd

I will check on Debian later. Leaving for a meeting shortly.

Tks

DarrenPIngram avatar Dec 17 '21 10:12 DarrenPIngram

There's no need to put whatever starts from # while running the commands. Those are just comments! You can omit that! Just use brew install smartcd

CodesOfRishi avatar Dec 17 '21 10:12 CodesOfRishi

That's what I did. I read (doh) the # as being a further argument (and then your comment about dependencies). I copied the entire path of action so you can see what happened.

On Fri, 17 Dec 2021 at 12:44, Rishi K. @.***> wrote:

There's no need to put whatever starts from # while running the commands. Those are just comments! You can omit that! Just use brew install smartcd

— Reply to this email directly, view it on GitHub https://github.com/CodesOfRishi/smartcd/issues/4#issuecomment-996619451, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABV5MABJ7S6MBT2UZHJK3W3URMIANANCNFSM5KDJSSIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

DarrenPIngram avatar Dec 17 '21 10:12 DarrenPIngram

It should work as which command is showing the path to smartcd.sh script.

Just open a new shell & try again!

CodesOfRishi avatar Dec 17 '21 15:12 CodesOfRishi

I had done that! That's how I tested it... will be on a desktop tomorrow and will check the Debian server.

—- Via iPad. Hopefully with not too many typos.

On 17. Dec 2021, at 17.26, Rishi K. @.***> wrote:

 It should work as which command is showing the path to smartcd.sh script.

Just open a new shell & try again!

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.

DarrenPIngram avatar Dec 17 '21 15:12 DarrenPIngram