clue / phar-composer

Simple phar creation for every PHP project managed via Composer
https://clue.engineering/2019/introducing-phar-composer
MIT License
855 stars 78 forks source link

Does not accept version ranges when building external packages #101

Closed Jeckerson closed 2 years ago

Jeckerson commented 4 years ago

Example for docs doesn't work

php -d phar.readonly=off phar-composer-1.1.0.phar build clue/phar-composer:~1.0

Output

[1/3] Cloning clue/phar-composer:~1.0 into temporary directory /tmp/phar-composer5

    Cloning into '/tmp/phar-composer5'...
    fatal: 'clue/phar-composer:~1.0' does not appear to be a git repository
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

  [UnexpectedValueException]
  Error status code: Invalid exit argument (code 128)

build [project] [target]
clue commented 3 years ago

@Jeckerson Thanks for reporting, I can indeed reproduce this locally.

The same command works fine without specifying a version number.

PRs to add/fix this would be very much welcome :shipit:

As much as I'd love to work on this myself, there are currently no immediate plans to build this from my end (no demand at the moment and more important outstanding issues currently). If you need this for a commercial project and you want to help sponsor this feature, feel free to reach out and I'm happy to take a look.

icedream commented 3 years ago

@clue I have just created a PR to fix this issue and a similar one I found while using the tool to build a PHAR for composer/composer:2.0.14, it also wrongly passed the URL check and so got misinterpreted as a repository URL.

I simply disallowed slashes to the left of colons and added previously passing examples to the relevant test case, hopefully that does it!