Packages

Ethereum library for Gleam - JSON-RPC client, transaction signing, ABI encoding, and wallet management on the BEAM

Current section

Files

Jump to
gleeth src test_ffi.erl
Raw

src/test_ffi.erl

-module(test_ffi).
-export([run_command/1]).
%% Run a shell command and return the output as a binary string.
%% Strips trailing newline.
run_command(Command) when is_binary(Command) ->
Output = os:cmd(binary_to_list(Command)),
Bin = unicode:characters_to_binary(Output),
string:trim(Bin, trailing, "\n").