davidrjonas / composer-lock-diff

See what has changed after a composer update
MIT License
274 stars 18 forks source link

Fix installation instructions #25

Closed ThomasLandauer closed 4 years ago

ThomasLandauer commented 4 years ago

This didn't work for me:

composer global require davidrjonas/composer-lock-diff:^1.0@dev

It created the davidrjonas directory in ~/.config/composer/vendor. So when running composer-lock-diff, I got "File not found".

Now, after manually copying composer-lock-diff to /usr/local/bin, I'm getting no output from running composer-lock-diff - so it's hard to say if I'm just in a wrong git status or if it still isn't working.

davidrjonas commented 4 years ago

Yes, you need to have ~/.composer/vendor/bin in your PATH. It's in the composer docs but it is pretty subtle, https://getcomposer.org/doc/03-cli.md#global

Make sure your global vendor binaries directory is in your $PATH environment variable

I'll look at adding something to the installation instructions.

davidrjonas commented 4 years ago

Fixed in 0927aed

ThomasLandauer commented 4 years ago

It looks like this still doesn't work :-( After doing

echo 'PATH=$PATH:$HOME/.composer/vendor/bin' >> ~/.profile

... echo $PATH (in new console window) still gives me the same as before.

This is my ~/.profile:

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

export PATH=~/.npm-global/bin:$PATH
PATH=$PATH:$HOME/.composer/vendor/bin

BTW: Why doesn't composer take care of this, when installing it globally?