Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If bin dir does not exists composer install/update failed #10

Closed
mfuehrer82 opened this issue Jan 6, 2017 · 3 comments
Closed

If bin dir does not exists composer install/update failed #10

mfuehrer82 opened this issue Jan 6, 2017 · 3 comments
Assignees
Labels

Comments

@mfuehrer82
Copy link

Expected behavior

  • Create bin dir if it does not exist and install tools

Actual behavior

  • Installation failed with
    [ErrorException] scandir(/app/path/bin): failed to open dir: No such file or directory

Steps to reproduce actual behavior

  • Delete bin dir and run composer update
  • Error occured into $this->removeFromDir()

Other information (e.g. version, os system, stacktraces, etc)

  • tooly version 1.2.3
@tommy-muehle tommy-muehle self-assigned this Jan 7, 2017
@tommy-muehle
Copy link
Owner

Good catch @mfuehrer82. Thank you. I had a condition to do this. But the "createDirectory" Method was originally created for files. So dirname() was called inside. And the result was that only the parent directory was checked if it existing.

I fixed it and release a new version 1.2.4 to solve this issue.

@mfuehrer82
Copy link
Author

Hey,
thanks for the fast reply. But i think that did not solve the problem i had. I had an error in the removeFromDir method. I add a fix into my fork and also add a test for it. Please give me some feedback what you think about.

@tommy-muehle
Copy link
Owner

tommy-muehle commented Jan 9, 2017

Hi,
have you updated your fork? And the "removeFromDir" method calls are part of the "cleanUp" method in which the condition still exist a few lines before.

if (false === is_dir($composerBinDirectory)) {
    $this->helper->getFilesystem()->createDirectory($composerBinDirectory);
}

$this->removeFromDir($composerBinDirectory);
$this->removeFromDir(...);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants