Giter Site home page Giter Site logo

Comments (8)

stecman avatar stecman commented on August 26, 2024 1

To prevent others running into this, I've updated the readme and hooks to find the correct dir using composer config --global home 👍

from composer-bash-completion-plugin.

stecman avatar stecman commented on August 26, 2024 1

I avoided doing that, since composer config home --global is relatively slow at around 100ms on my machine (as mentioned in the commit message above). I find slow shell start-up a pain, so I was mitigating this for others - the time all adds up, and next thing you know you have to wait several seconds to be able to use a new shell.

If someone was ok with the slow down, they could use the current generate-hook script in their shell profile like this:

source <(source $(composer config home --global)/vendor/stecman/composer-bash-completion-plugin/generate-hook)

from composer-bash-completion-plugin.

stecman avatar stecman commented on August 26, 2024

Can you confirm this command outputs the directory you need?

echo $XDG_DATA_HOME/composer

That's mentioned in the composer docs but not checked in this plugin at the moment.

from composer-bash-completion-plugin.

natanfelles avatar natanfelles commented on August 26, 2024

Hello! 😃

No. Terminal in/out:

echo $XDG_DATA_HOME/composer
/composer

from composer-bash-completion-plugin.

stecman avatar stecman commented on August 26, 2024

Oh I see, Composer explicitly defaults to $HOME/.config/composer if $XDG_CONFIG_HOME is empty/not set.

from composer-bash-completion-plugin.

natanfelles avatar natanfelles commented on August 26, 2024

Hi, @stecman .

Initially I had modified this line in your project.

But revising more, I just modified my .bashrc and solved:

COMPOSER_HOME="$HOME/.config/composer"
source "$COMPOSER_HOME/vendor/stecman/composer-bash-completion-plugin/hooks/bash-completion"

Completions are working fine now.

Thank you!

from composer-bash-completion-plugin.

natanfelles avatar natanfelles commented on August 26, 2024

Wow that's a smarter way. I'll update here too. Thanks!

from composer-bash-completion-plugin.

natanfelles avatar natanfelles commented on August 26, 2024

You could update the generate-hook file to:

# Generate registration code to go in a shell profile

_composercomplete_hook_dir="$(composer config home --global)/vendor/stecman/composer-bash-completion-plugin/hooks"

if [ ! -z $BASH_VERSION ]; then
	source $_composercomplete_hook_dir/bash-completion
fi

if [ ! -z $ZSH_VERSION ]; then
	source $_composercomplete_hook_dir/zsh-completion
fi

unset _composercomplete_hook_dir

from composer-bash-completion-plugin.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.