Skip to content

Use an absolute path for the global composer bin dir #310

Open
@ghost

Description

Expected Behavior

When running a binary through Symfony\Component\Process\ExecutableFinder it should be able to find the binary automatically.

Current Behavior

When using grumphp which relies on Symfony\Component\Process\ExecutableFinder the path that refers to $HOME with ~ does not work:

ENV PATH="$PATH:./vendor/bin:~/.composer/vendor/bin"

Possible Solution

You could make an argument that Symfony should be able to locate this better. But I think that modifying the PATH variable to include the absolute path for the composer binary is the easiest fix.

Steps to Reproduce (for bugs)

# Require package globally.
composer global require phpro/grumphp
# Try initializing the grumphp git hooks.
grumphp git:init
# Set an absolute path for composer binary.
export PATH=$PATH:/home/docker/.composer/vendor/bin
# Re run the initialization of grumphp git hooks.
grumphp git:init

Context

Trying to implement coding standards with the phpro/grumphp package installed globally.

Your Environment

Not relevant.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions