nerves_hub_cli v0.10.1 Mix.NervesHubCLI.Utils

Link to this section Summary

Functions

Return the path to the generated firmware bundle

Read the firmware metadata from the specified firmware bundle

Print the API endpoint that's being used to communicate with the NervesHub server

Split up a string of comma-separated tags

Turn map keys into strings

Link to this section Functions

Link to this function

fetch_metadata_item(metadata, key)

Specs

fetch_metadata_item(String.t(), String.t()) ::
  {:ok, String.t()} | {:error, :not_found}

Specs

firmware() :: Path.t()

Return the path to the generated firmware bundle

Link to this function

get_metadata_item(metadata, key, default \\ nil)

Specs

get_metadata_item(String.t(), String.t(), any()) :: String.t() | nil
Link to this function

metadata(firmware)

Specs

metadata(Path.t()) :: {:error, any()} | {:ok, map()}

Read the firmware metadata from the specified firmware bundle

Specs

org(keyword()) :: String.t()

Specs

product(keyword()) :: String.t()
Link to this function

show_api_endpoint()

Specs

show_api_endpoint() :: :ok

Print the API endpoint that's being used to communicate with the NervesHub server

Link to this function

split_tag_string(str)

Specs

split_tag_string(String.t()) :: [String.t()]

Split up a string of comma-separated tags

Invalid tags raise.

iex> Mix.NervesHubCLI.Utils.split_tag_string("a, b, c") ["a", "b", "c"]

iex> Mix.NervesHubCLI.Utils.split_tag_string("a space tag, b, c") ** (RuntimeError) Tag 'a space tag' should not contain white space

iex> Mix.NervesHubCLI.Utils.split_tag_string("\"tag_in_quotes\"") ** (RuntimeError) Tag '"tag_in_quotes"' should not contain quotes

Specs

stringify(map()) :: map()

Turn map keys into strings