Comments (8)
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.
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.
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.
Hello! 😃
No. Terminal in/out:
echo $XDG_DATA_HOME/composer
/composer
from composer-bash-completion-plugin.
Oh I see, Composer explicitly defaults to $HOME/.config/composer
if $XDG_CONFIG_HOME
is empty/not set.
from composer-bash-completion-plugin.
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.
Wow that's a smarter way. I'll update here too. Thanks!
from composer-bash-completion-plugin.
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)
- [Feature] Complete packages after require statement HOT 3
- Autocomplete custom scripts
- Dependency of the old symfony-console-completion HOT 3
- Composer 2 Support HOT 1
- Symfony Package Conflicts HOT 2
- [Bug][Feature] composer global doesn't work with completions.
- The "--shell-type" option does not exist HOT 2
- [Bug][Feature] The composer help command should have completions. HOT 1
- [Feature] Complete currently required packages with composer {update,remove} HOT 1
- [Bug] The snippets should respect COMPOSER_HOME env var HOT 1
- [Feature] Provide ready to use bash/zsh files to download. HOT 2
- This plugin does not work anymore HOT 1
- Conflict with symfony/console 3.2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from composer-bash-completion-plugin.