Sentix v1.0.1 Sentix.Bridge.Command

This module provides command construction for executing fswatch. This module could easily live inside Sentix.Bridge but has been separated in order to ease testing.

Summary

Functions

Generates a flattened list of command segments which can be used to spawn an fswatch port

Functionally identical to generate/1, but extracts the options instead of returning as a Tuple

Provides the location of the fswatch executable

Functions

generate(exe, opts, paths)

Specs

generate(binary :: binary, options :: [binary], paths :: [binary]) :: {:ok, flags :: [[char]]}

Generates a flattened list of command segments which can be used to spawn an fswatch port.

We flatten everything down to a single level list, and convert all binaries to charlists. This is done using a custom recursion in order to aid performance.

generate!(exe, opts, paths)

Specs

generate!(binary :: binary, options :: [binary], paths :: [binary]) :: flags :: [[char]]

Functionally identical to generate/1, but extracts the options instead of returning as a Tuple.

locate_fswatch()

Specs

locate_fswatch ::
  {:ok, path :: binary} |
  {:error, reason :: binary}

Provides the location of the fswatch executable.