File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ defmodule Mix.Local do
7
7
The path for local tasks.
8
8
"""
9
9
def tasks_path do
10
- Path . join Mix.Utils . user_home , ".mix/ tasks"
10
+ Path . join Mix.Utils . mix_home , "tasks"
11
11
end
12
12
13
13
@ doc """
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ defmodule Mix.Utils do
15
15
"""
16
16
17
17
@ doc """
18
- Gets the user home attempting to consider OS system diferences.
18
+ Gets the mix home. It defaults to `~/.mix` unless the
19
+ MIX_HOME environment variable is set.
19
20
"""
20
- def user_home do
21
- System . get_env ( "MIX_HOME" ) || System . get_env ( "HOME" ) || System . get_env ( "USERPROFILE" ) ||
22
- raise Mix.Error , message: "Nor MIX_HOME, HOME or USERPROFILE env variables were set"
21
+ def mix_home do
22
+ System . get_env ( "MIX_HOME" ) || Path . expand ( "~/.mix" )
23
23
end
24
24
25
25
@ doc """
@@ -285,7 +285,7 @@ defmodule Mix.Utils do
285
285
286
286
@ doc """
287
287
Takes a command and converts it to a module name format.
288
-
288
+
289
289
## Examples
290
290
291
291
command_to_module_name("compile.elixir")
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ defmodule Mix.Tasks.LocalTest do
5
5
6
6
test "manage local tasks" do
7
7
File . rm_rf! tmp_path ( "userhome" )
8
- System . put_env "MIX_HOME" , tmp_path ( "userhome" )
8
+ System . put_env "MIX_HOME" , tmp_path ( "userhome/.mix " )
9
9
10
10
# Install it!
11
11
self <- { :mix_shell_input , :yes? , true }
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ defmodule MixTest.Case do
57
57
Mix.Task . clear
58
58
Mix.Shell.Process . flush
59
59
Mix.Deps.Converger . clear_cache
60
- System . put_env ( "MIX_HOME" , tmp_path )
60
+ System . put_env ( "MIX_HOME" , tmp_path ( ".mix" ) )
61
61
del_tmp_paths
62
62
end
63
63
You can’t perform that action at this time.
0 commit comments