Incorrect Installer Output (on success) #638

Closed
wilmoore opened this Issue Apr 28, 2012 · 4 comments

Projects

None yet

2 participants

@wilmoore
Contributor

Command:

curl -s http://getcomposer.org/installer | php -- --install-dir=bin

Desired Output:

Use it: php bin/composer.phar

Current Output:

Use it: php composer.phar
@wilmoore
Contributor

One problem I see in even opening this can of worms is:

curl -s http://getcomposer.org/installer | php -- --install-dir=bin

Output:

Use it: php /Users/whomever/projects/SweetProject/bin/composer.phar

The above could be fixed given we know it is a relative path; however, what about this:

curl -s http://getcomposer.org/installer | php -- --install-dir=/fully/qualified/path/to/bin

Output:

Use it: php /fully/qualified/path/to/bin/composer.phar

My proposal is to check for relative vs. qualified path and:

  1. grab a copy of $installDir to be used only for output purposes
  2. if relative, drop prefix of getcwd() from output version of $installDir
  3. if qualified, do nothing (use as-is)
@Seldaek
Member
Seldaek commented Apr 29, 2012

Why 3? I'd just say we output $installDir/composer.phar because that'll always work, if it looks ugly so it goes, don't pass it long absolute paths :)

@Seldaek
Member
Seldaek commented May 1, 2012

Fixed

@Seldaek Seldaek closed this May 1, 2012
@wilmoore
Contributor
wilmoore commented May 1, 2012

Tested...works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment