Skip to content

Instantly share code, notes, and snippets.

@Virviil
Created November 26, 2017 19:41
Show Gist options
  • Save Virviil/34d81f3d795b8d6dff80ab8f98fb6f87 to your computer and use it in GitHub Desktop.
Save Virviil/34d81f3d795b8d6dff80ab8f98fb6f87 to your computer and use it in GitHub Desktop.
Set elixir project's version
def set_version(version) do
Agent.update(Mix.ProjectStack, fn state ->
%{stack: [%{config: config_keyword}]} = state
new_config_keyword = Keyword.put(config_keyword, :version, version)
Map.put(state, :stack, [%{config: new_config_keyword}])
end)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment