Skip to content

Commit a71effa

Browse files
warn when bootstrap was started but the target aliases were not added.
1 parent 74ed9c8 commit a71effa

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

lib/nerves_bootstrap/aliases.ex

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ defmodule Nerves.Bootstrap.Aliases do
2222
update_in(config, [:aliases], &add_host_aliases(&1))
2323
end
2424

25-
def target_config(config, nil), do: config
26-
def target_config(config, "host"), do: config
25+
def target_config(config, nil), do: host_only(config)
26+
def target_config(config, "host"), do: host_only(config)
2727

2828
def target_config(config, target) do
2929
Mix.shell().info([
@@ -93,4 +93,17 @@ defmodule Nerves.Bootstrap.Aliases do
9393
defp drop(aliases, a) do
9494
Enum.reject(aliases, &(&1 === a))
9595
end
96+
97+
defp host_only(config) do
98+
Mix.shell().info([
99+
IO.ANSI.yellow(),
100+
"""
101+
Nerves Environment not loaded.
102+
MIX_TARGET is unset
103+
""",
104+
IO.ANSI.reset()
105+
])
106+
107+
config
108+
end
96109
end

0 commit comments

Comments
 (0)