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

Documentation for TmpDir wrong #681

Open
pixelbrackets opened this issue Mar 1, 2018 · 1 comment
Open

Documentation for TmpDir wrong #681

pixelbrackets opened this issue Mar 1, 2018 · 1 comment

Comments

@pixelbrackets
Copy link
Contributor

Steps to reproduce

Install Robo 1.2.2
Execute example code from https://github.com/consolidation/Robo/blob/master/docs/tasks/Filesystem.md#tmpdir

Expected behavior

Create a temporary directory.

Actual behavior

PHP Fatal error:  Uncaught Error: Call to a member function getPath() on string in RoboFile.php

System Configuration

PHP 7, Ubuntu 16.04, Robo 1.2.2

Reason

The documentation mixes configuration for taskTmpDirwith building a collection. The collection builder however returns not the temp-dir object, but the path string instead. See https://github.com/consolidation/Robo/blob/master/src/Collection/CollectionBuilder.php#L134

Solution

Remove ->getPath()in the example code. Add another example for the taskTmpDir task (since all other tasks on the same page are documented like this as well).

If you agree with the solution I could send a PR.

@AbAvramidis
Copy link

Thanks a lot @pixelbrackets for this comment, either after so many years that comment helped me a lot to solve this error.
could not find this comment somewhere else and still is not updated in the Docs. So sad that they did not fix that.

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

No branches or pull requests

2 participants