File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -747,6 +747,14 @@ defmodule Mix do
747747 end
748748 end
749749
750+ @ doc """
751+ Returns whether `Mix.install/2` was called in the current node.
752+ """
753+ @ doc since: "1.13.0"
754+ def installed? do
755+ Mix.State . get ( :installed ) != nil
756+ end
757+
750758 defp stop_apps ( [ ] ) , do: :ok
751759
752760 defp stop_apps ( apps ) do
Original file line number Diff line number Diff line change @@ -137,6 +137,16 @@ defmodule MixTest do
137137 Application . delete_env ( :unknown_app , :foo , persistent: true )
138138 end
139139
140+ test "install?" , % { tmp_dir: tmp_dir } do
141+ refute Mix . installed? ( )
142+
143+ Mix . install ( [
144+ { :install_test , path: Path . join ( tmp_dir , "install_test" ) }
145+ ] )
146+
147+ assert Mix . installed? ( )
148+ end
149+
140150 defp test_project ( % { tmp_dir: tmp_dir } ) do
141151 path = :code . get_path ( )
142152
You can’t perform that action at this time.
0 commit comments