JordanRL / Roster

A PHP tool to generate templateable markdown documentation from the docblocks or type-hints of your codebase.
GNU General Public License v3.0
15 stars 0 forks source link

Bug found in: document generator(?) #10

Open SDanDyS opened 3 years ago

SDanDyS commented 3 years ago

Describe the bug Whenever I try to use the command-line to generate docs for my project it throws the following error: [ERROR] Could not create export path I run it like this: php vendor/bin/roster C:\xampp\htdocs\framework\classes

To Reproduce Steps to reproduce the behavior:

  1. Open git-bash (Windows) in your root directory. In my case I want to generate documentation for the project framework, so I open git-bash in framework.
  2. I run it like this: php vendor/bin/roster C:\xampp\htdocs\framework\classes (classes is basically the src folder most people use for their classes etc.)
  3. results in: [ERROR] Could not create export path

Expected behavior It will throw the following error: [ERROR] Could not create export path

PHP Version 8.0

Additional context I do have permission within the directory. I open my git-bash in the framework directory (which would be the root).

JordanRL commented 3 years ago

How would you want this to be handled when you don't have permissions on the directory? Would you like to specify and export path?

SDanDyS commented 3 years ago

I think this would solve a lot of ear scratching yes.

I think being able to specify an export path would enable users without permission to still use the documentor and people who end up having this error (still unknown as to why to me), even though with permission, would be able to set a path themselves.

JordanRL commented 3 years ago

This error happens when the program cannot create the directories or files that it's generating, usually because of file permissions. The program gets its file permissions from the user that executes the php interpreter.

I'll add an export path option.

JordanRL commented 3 years ago

Hey, so I pushed changes that should fix this. In reality, Roster wasn't handling Windows paths correctly, which I think was the core issue.

I don't have a Windows setup to actually test it with though. If you could checkout the b-export-path branch and test it that would be fantastic.

SDanDyS commented 3 years ago

The error remains when I try to generate it via git-bash (the above principle was applied).

How I tried to generate the docs php vendor/bin/roster C:\xampp\htdocs\framework\classes php vendor/bin/roster classes

Additional information: I get the additional information after the error [ERROR] Could not create export path: Check that you have file permissions.

I have checked, I have the permission to modify, create, delete etc. files and directories.

JordanRL commented 3 years ago

Alright, I don't think I'll be able to solve this without creating a Windows test-bed with git-bash, so it'll take a bit longer.