Skip to content

Set schemas path relative to executable #21

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

Merged
merged 1 commit into from
Nov 12, 2020
Merged

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Nov 10, 2020

Previously, the schemas path was defined relative to the working directory, but the schemas will be stored in a path
relative to the arduino-check executable, which may not necessarily be in the working directory.

Unfortunately, this breaks the ability to run the code using go run because the executable path is the temporary directory the program is run from and the schemas are not under that path. I did some searching for a solution to this and found none worth consideration (example: https://github.com/golang/go/issues/5157, https://stackoverflow.com/questions/18537257/how-to-get-the-directory-of-the-currently-running-file).

I would welcome any suggestions for how to properly handle defining the path to data files that accompany the tool.

Previously, the schemas path was defined relative to the working directory, but the schemas will be stored in a path
relative to the arduino-check executable.
@per1234 per1234 requested review from silvanocerza and a team November 10, 2020 14:31
@silvanocerza
Copy link
Contributor

If you still want the ability to run it using go run probably the best best would be to pass the schema path as an argument to the tool.

@per1234
Copy link
Contributor Author

per1234 commented Nov 12, 2020

I don't foresee the users of the tool ever having the need to specify a custom schemas path, so adding this setting would be only for the sake of go run compatibility. I am just using go build && ./arduino-check so it doesn't bother me to do without go run.

My concern is about whether this will be a problem for other contributors. I suppose it's best to wait to see whether there are any complaints before adding special provisions for this usage.

@per1234 per1234 merged commit 9d29588 into main Nov 12, 2020
@per1234 per1234 deleted the per1234/fix-schemas-path branch November 12, 2020 11:48
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Sep 29, 2021
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants