mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-02-05 08:18:06 +00:00
23 lines
405 B
Elixir
23 lines
405 B
Elixir
defmodule CfCommon.CLI do
|
|
@moduledoc """
|
|
Handles low-level CLI facilities.
|
|
"""
|
|
|
|
def bash(cmd) do
|
|
System.cmd("bash", ["-c", cmd])
|
|
end
|
|
|
|
def exec!(cmd) do
|
|
case bash(cmd) do
|
|
{result, 0} ->
|
|
result
|
|
|
|
{error, _} ->
|
|
raise """
|
|
Error executing command #{cmd} with error #{error}.
|
|
CloudFire cannot recover from this error.
|
|
"""
|
|
end
|
|
end
|
|
end
|