diff --git a/example/DotEnv.Core.Example.csproj b/example/DotEnv.Core.Example.csproj index 9922bf3..1ff6291 100644 --- a/example/DotEnv.Core.Example.csproj +++ b/example/DotEnv.Core.Example.csproj @@ -1,4 +1,4 @@ - + Exe @@ -11,4 +11,8 @@ + + + + diff --git a/props/DotEnv.Core.nuspec b/props/DotEnv.Core.nuspec new file mode 100644 index 0000000..f26dcff --- /dev/null +++ b/props/DotEnv.Core.nuspec @@ -0,0 +1,29 @@ + + + + DotEnv.Core.Props + 1.0.1 + David Román Amariles + David Román Amariles + https://github.com/MrDave1999/dotenv.core + MIT + README.md + dotenv-icon-nuget.png + false + + dotenv.core.props is a file that represents a set of properties that will tell MSBuild to copy the .env files + from the project folder to the publish directory. + + + - fix: Added .props extension to the build/DotEnv.Core.Props file. + + Copyright ©2023 David Román Amariles + properties props dotenv env environment variables + + + + + + + + \ No newline at end of file diff --git a/props/README.md b/props/README.md new file mode 100644 index 0000000..3c07628 --- /dev/null +++ b/props/README.md @@ -0,0 +1,26 @@ +**DotEnv.Core.Props** is a file that represents a set of properties that will tell MSBuild to copy the .env files from the project folder to the publish directory. + +This .props file **excludes** the following sample .env files: +- `.env.example` +- `example.env` +- `.env.sample` +- `sample.env` +- `.env.template` +- `template.env` + +## Installation + +Run the following command from the terminal: +``` +dotnet add package DotEnv.Core.Props +``` + +## How to use it? + +The .props file does not need to be used directly, simply run the `dotnet publish` command and MSBuild will copy the .env files to the publish directory. + +Remember that .env files must follow either of these two conventions: +- `.env.{name}` (e.g., .env.config). +- `{name}.env` (e.g., config.env). + +Following these conventions is necessary for MSBuild to know which file to copy to the publish directory. \ No newline at end of file diff --git a/props/build/DotEnv.Core.Props.props b/props/build/DotEnv.Core.Props.props new file mode 100644 index 0000000..85b1feb --- /dev/null +++ b/props/build/DotEnv.Core.Props.props @@ -0,0 +1,31 @@ + + + + + + $(DefaultItemExcludes); + **\.env.example; + **\example.env; + **\.env.sample; + **\sample.env; + **\.env.template; + **\template.env + + + + + + + + + \ No newline at end of file