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

Add support for absolute paths in envFileName #137

Closed
ruurtjan opened this issue Apr 1, 2022 · 2 comments
Closed

Add support for absolute paths in envFileName #137

ruurtjan opened this issue Apr 1, 2022 · 2 comments

Comments

@ruurtjan
Copy link
Contributor

ruurtjan commented Apr 1, 2022

Sbt-dotenv currently always prepends the envFileName with the base directory.

val dotEnvFile: File = new File(s"${baseDirectory}/${fileName}")

I think it would make sense to check if the first character of envFileName is a /, and if so, don't prepend the base directory.

The use case for me would be to inject an envfile in GitLab CI. It allows you to define environment specific files, and provides an absolute path to these files in an environment variable. It would be convenient to be able to plug that into sbt cli like so:
sbt "set ThisBuild / envFileName := \"$SBT_DOT_ENV\"" test

Would you accept a PR for this?

@Philippus
Copy link
Owner

Sure, sounds like a welcome addition.

ruurtjan added a commit to ruurtjan/sbt-dotenv that referenced this issue Apr 4, 2022
Philippus added a commit that referenced this issue Apr 12, 2022
@Philippus
Copy link
Owner

Fixed in #139.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants