@@ -67,7 +67,7 @@ defmodule MixDocker do
6767 { sha , 0 } <- System . cmd ( "git" , [ "rev-parse" , "HEAD" ] ) do
6868 String . slice ( sha , 0 , 10 )
6969 else
70- _ -> nil
70+ _ -> ""
7171 end
7272 end
7373
@@ -76,7 +76,7 @@ defmodule MixDocker do
7676 { count , 0 } <- System . cmd ( "git" , [ "rev-list" , "--count" , "HEAD" ] ) do
7777 String . trim ( count )
7878 else
79- _ -> nil
79+ _ -> ""
8080 end
8181 end
8282
@@ -93,13 +93,17 @@ defmodule MixDocker do
9393 count = git_commit_count ( )
9494 sha = git_head_sha ( )
9595
96- Code . eval_string ( version_template , mix_version: version , git_count: count , git_sha: sha ) |> elem ( 0 )
96+ version_template
97+ |> String . replace ( "$mix_version" , version )
98+ |> String . replace ( "$git_count" , count )
99+ |> String . replace ( "$git_sha" , sha )
97100 end
98101 defp image_tag ( tag ) , do: tag
99102
100103 defp image_version ( args ) do
101- version = ( OptionParser . parse ( args ) |> elem ( 0 ) |> Keyword . get ( :version , Application . get_env ( :mix_docker , :version , "\# {mix_version}.\# {git_count}-\# {git_sha}" ) ) )
102- "\" " <> version <> "\" "
104+ OptionParser . parse ( args ) |> elem ( 0 ) |> Keyword . get ( :version )
105+ || Application . get_env ( :mix_docker , :version )
106+ || "$mix_version.$git_count-$git_sha"
103107 end
104108
105109 defp docker ( :cp , cid , source , dest ) do
0 commit comments