Currently in order for this project to function as intended, users would have to open the source file and manually add in their MyAnimeList token. This is generally a bad practice and prevents this project from having a good CI/CD process in place.
Instead of requiring the token to be added within the source file, update the code to read from an environment variable instead. This environment variable should be named something like MYANIMELIST_CLIENT_ID.
The Contribution docs should also be updated with the accurate instructions on how to set the CLIENT_ID.
Though not required for the completion of this specific task, proper error handling in case the environment variable does not exist or is an invalid value would be a nice bonus.
Task Context
Currently in order for this project to function as intended, users would have to open the source file and manually add in their MyAnimeList token. This is generally a bad practice and prevents this project from having a good CI/CD process in place.
https://github.com/jmakhack/myanimelist-cli/blob/587fa4fd9f96166e7c4583576ab701df2b1224cd/src/mya.c#L14
Acceptance Criteria
Instead of requiring the token to be added within the source file, update the code to read from an environment variable instead. This environment variable should be named something like
MYANIMELIST_CLIENT_ID
.The Contribution docs should also be updated with the accurate instructions on how to set the
CLIENT_ID
.Though not required for the completion of this specific task, proper error handling in case the environment variable does not exist or is an invalid value would be a nice bonus.
Additional Context
The
getenv()
function found in thestdlib
library is one potential way to complete this task: https://www.tutorialspoint.com/c_standard_library/c_function_getenv.htmPlease read through the Contributing to the Project document before working on this project.