aboutsummaryrefslogtreecommitdiff
path: root/src/http_ffi.erl
diff options
context:
space:
mode:
authorHayleigh Thompson <me@hayleigh.dev>2024-01-10 08:30:49 +0000
committerHayleigh Thompson <me@hayleigh.dev>2024-01-10 08:30:49 +0000
commitf9be962cc59cb5e75c0f50aba99a78f1090c3dad (patch)
treec1b34691cdf0b448b0addcf0e96b8ed636a58e48 /src/http_ffi.erl
parent57d124d9c0b5c8bbf5157b407599f38cb466965d (diff)
downloadlustre-f9be962cc59cb5e75c0f50aba99a78f1090c3dad.tar.gz
lustre-f9be962cc59cb5e75c0f50aba99a78f1090c3dad.zip
:sparkles: Always run 'gleam build' before starting lustre/try.
Diffstat (limited to 'src/http_ffi.erl')
-rw-r--r--src/http_ffi.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/http_ffi.erl b/src/http_ffi.erl
index 355fabd..f64c559 100644
--- a/src/http_ffi.erl
+++ b/src/http_ffi.erl
@@ -1,5 +1,8 @@
-module(http_ffi).
--export([serve/3, response_default_headers/0]).
+-export([exec/1, serve/3, response_default_headers/0]).
+
+exec(Command) ->
+ os:cmd(binary_to_list(Command)).
serve({options, Host, Port, IncludeStyles}, OnStart, OnPortTaken) ->
{ok, Pattern} = re:compile("name *= *\"(?<Name>.+)\""),
@@ -16,7 +19,7 @@ serve({options, Host, Port, IncludeStyles}, OnStart, OnPortTaken) ->
" <title>Lustre preview server</title>\n",
case IncludeStyles of
true ->
- <<" <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/gh/lustre-labs/ui/priv/styles.css\">\n">>;
+ <<" <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/gh/lustre-labs/ui/priv/styles.css\">\n">>;
false ->
<<"">>
end/binary,