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

Bug: Relative path issues / incorrect handling of "output file" options if called from nested directory #14

Open
joshuatz opened this issue Jan 15, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@joshuatz
Copy link
Owner

This does not seem to be handling output file options correctly if called from a nested directory, and GDE is told the project root via CLI.

For example:

/ (root) (git dir)
-/ project_a
-/ project_a / test.txt

If I cd to project_a, and run something like:

echo "project_a/test.txt" | xargs git-date-extractor --projectRootPath=".." --outputToFile

I neither get the output file generated at ../timestamps.json (which could be one expected result, given that I told it that project root was a level up), nor at project_a/timestamps.json, since that is calling dir... I get the generated output file at ../../timestamps.json, which is entirely outside the project directory itself!


In general, there seems to be a few issues if projectRootPath is passed as a relative path (e.g. ="..") instead of an absolute path by using something like __dirname, %cd%, or $PWD. I should probably improve the logic for parsing that CLI argument and determining the true absolute project root path. Even though I would suggest that users use absolute paths as input args whenever possible, this still really should be improved beyond how it currently is acting.

@joshuatz joshuatz added the bug Something isn't working label Jan 15, 2021
@joshuatz joshuatz changed the title Bug: Incorrect handling of "output file" options if called from nested directory Bug: Relate path issues / incorrect handling of "output file" options if called from nested directory Jan 15, 2021
@joshuatz joshuatz changed the title Bug: Relate path issues / incorrect handling of "output file" options if called from nested directory Bug: Relative path issues / incorrect handling of "output file" options if called from nested directory Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant