diff --git a/Dockerfile b/Dockerfile index bece532..99959b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,3 +6,4 @@ RUN apt-get update && apt-get install -y python3-pygments RUN luarocks install sitegen CMD ["sh", "-c", "openresty -p `pwd` -g 'daemon off;'"] +# CMD ["openresty", "-p", "/opt/app", "-g", "daemon off;"] diff --git a/docs/2023-08-03-recursively-list-all-files-in-a-directory-with-elixir.md b/docs/2023-08-03-recursively-list-all-files-in-a-directory-with-elixir.md index 469fbf4..e54eccc 100644 --- a/docs/2023-08-03-recursively-list-all-files-in-a-directory-with-elixir.md +++ b/docs/2023-08-03-recursively-list-all-files-in-a-directory-with-elixir.md @@ -8,7 +8,7 @@ We wish to print a list of all the files in a directory, ignoring files beginnin Finds all files in the `path` directory recursively, ignoring any files or directories that start with any of the characters in the `@starts_with` module attribute. -``` +```elixir defmodule Files do @starts_with [".", "_"] @@ -39,7 +39,7 @@ end The data structure holding the results of the file search. -``` +```iex iex(1)> directory_tree = Files.find("hello") {"hello", [ @@ -77,7 +77,7 @@ iex(1)> directory_tree = Files.find("hello") Sort alphabetically, with directories last. Downcase before comparing strings. -``` +```elixir defmodule Paths do def puts(dir_tree), do: dir_tree |> print() |> Enum.join("\n") |> IO.puts() @@ -103,7 +103,7 @@ end Print all the files sorted. -``` +```iex iex(2)> Paths.puts(directory_tree) hello/mix.exs hello/README.md