-
Notifications
You must be signed in to change notification settings - Fork 126
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
Support custom .env file location via CLI/env #856
Conversation
The changes in the
These changes improve error handling and configuration management within the CLI package. LGTM 🚀
|
dotEnvPath = dotEnvPath || process.env.GENAISCRIPT_ENV_FILE | ||
if (dotEnvPath) { | ||
// if the user provided a path, check file existence | ||
if (!(await exists(dotEnvPath))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exists
function is awaited, but it is not clear if it returns a Promise. Ensure that exists
is an asynchronous function returning a Promise. If not, remove the await
keyword. 🔍
generated by pr-review-commit
async_await_misuse
dotEnvPath = dotEnvPath || process.env.GENAISCRIPT_ENV_FILE | ||
if (dotEnvPath) { | ||
// if the user provided a path, check file existence | ||
if (!(await exists(dotEnvPath))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exists
function is used as if it returns a promise, but it's not clear if it is an async function. Ensure that exists
is an async function or handle it appropriately.
generated by pr-review-commit
async_function
Introduce the ability to specify a custom
.env
file location through a CLI argument or an environment variable. Update documentation to reflect these changes.Fix for #837
📁 Custom .env File Support: Introduced the ability to specify custom
.env
file locations in the documentation. Users can now define a custom path using the--env <file>
CLI argument or by setting theGENAISCRIPT_ENV_FILE
environment variable.🛠️ Error Logging Enhancement: Improved error logging by ensuring stack traces are only logged if both a stack is present and a
nodeHost
exists. This adds an additional check before printing verbose logs in non-quiet modes.🏗️ Configuration Flexibility: Enhanced the
NodeHost
class with more flexible.env
file handling. It now checks for the existence of a.env
file at a user-specified location, throwing an error if the file does not exist. If no custom path is provided, it defaults to resolving the standard.env
filename.