mudrd8mz / moodle-tool_pluginskel

Generator of Moodle plugins skeletons
https://moodle.org/plugins/tool_pluginskel
Other
51 stars 46 forks source link

Using a absolute path (at least in MacOS) for t --recipe= is mandatory #88

Closed lucaboesch closed 3 years ago

lucaboesch commented 6 years ago

I'm trying to use the Plugin Skeleton Generator (Moodle 3.6 weekly master) and it keeps giving "Invalid recipe file!" Intuitively even trying php cli/generate.php --recipe=cli/example.yaml --target-dir=/tmp which I would suppose should work (since you are giving that example file away) does trigger that warning. It turns out you have to pass the absolute path to the YAML recipe file. Then the skeleton generation succeeds.

mudrd8mz commented 6 years ago

It seems the relative paths are broken in a way that they must be relative to the directory where generate.php is located. Thence --recipe=example.yaml works because they are in the same folder.

andyzito commented 5 years ago

This happened to me as well and strikes me as an unexpected behavior. It would be easily ameliorated by changing the error message to "Recipe file not found" or similar.

mudrd8mz commented 3 years ago

Commit 418380e082b84f18d8451dfd05b24f3ba537b767 introduces support for relative paths on operating systems that support the PWD environment variable.