Skip to content

Commit

Permalink
doc: make it easier to copy snippets and paste into own project
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed May 24, 2024
1 parent 4654ad6 commit 7ad70b1
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,29 +115,29 @@ so that some mix env vars are properly set based on the `BLEND` env var before r

##### 2. Modify your `mix.exs`.

```elixir
# mix.exs

Code.compile_file("blend/premix.exs") # New

defmodule YourApp.MixProject do
...
def project do
[
...
]
|> Keyword.merge(maybe_lockfile_option()) # New
end
....

defp maybe_lockfile_option do # New
case System.get_env("MIX_LOCKFILE") do #
nil -> [] #
"" -> [] #
lockfile -> [lockfile: lockfile] #
end #
end #
end
```diff
# mix.exs

+Code.compile_file("blend/premix.exs")

defmodule YourApp.MixProject do
...
def project do
[
...
]
+ |> Keyword.merge(maybe_lockfile_option())
end
....

+ defp maybe_lockfile_option do
+ case System.get_env("MIX_LOCKFILE") do
+ nil -> []
+ "" -> []
+ lockfile -> [lockfile: lockfile]
+ end
+ end
end
```

##### 3. Enjoy
Expand Down

0 comments on commit 7ad70b1

Please sign in to comment.