Describe the bug
Passing --env with a nested path (for example config/.env.prod) loses the directory information because path.basename() is used.
As a result, the tool only keeps ".env.prod" and assumes the file is located in the current working directory.
This can cause the wrong file to be used for comparison when the file actually exists in a subdirectory.
Expected behavior
The full path provided via --env should be preserved and used instead of stripping it to only the filename.
Additional context
This occurs in discoverEnvFiles.ts where envFlag is converted using path.basename().
Describe the bug
Passing --env with a nested path (for example config/.env.prod) loses the directory information because path.basename() is used.
As a result, the tool only keeps ".env.prod" and assumes the file is located in the current working directory.
This can cause the wrong file to be used for comparison when the file actually exists in a subdirectory.
Expected behavior
The full path provided via --env should be preserved and used instead of stripping it to only the filename.
Additional context
This occurs in discoverEnvFiles.ts where envFlag is converted using path.basename().