View Source Mix.Nerves.Utils (nerves v1.7.17)
Link to this section Summary
Link to this section Functions
@spec check_nerves_system_is_set!() :: String.t()
@spec check_nerves_toolchain_is_set!() :: String.t()
@spec mix_target() :: atom()
Parse OTP versions
OTP versions can have anywhere from 2 to 5 parts. Normalize this into a 3-part version for convenience. This is a lossy operation, but it doesn't matter because the checks aren't needed in this project.
iex> {:ok, version} = Mix.Nerves.Utils.parse_otp_version("24.2")
iex> version
#Version<24.2.0>
iex> {:ok, version} = Mix.Nerves.Utils.parse_otp_version("23.3.4")
iex> version
#Version<23.3.4>
iex> {:ok, version} = Mix.Nerves.Utils.parse_otp_version("18.3.4.1.1")
iex> version
#Version<18.3.4>
iex> {:ok, version} = Mix.Nerves.Utils.parse_otp_version("23.0-rc1")
iex> version
#Version<23.0.0-rc1>
iex> Mix.Nerves.Utils.parse_otp_version("invalid")
{:error, "Unexpected OTP version: \"invalid\""}
@spec sanitize_path() :: binary()
Return the sanitized version of the PATH variable
This removes empty PATH entries to avoid tool confusion.