logo

clairvoyance

Unnamed repository; edit this file 'description' to name the repository.

scan.ex (370B)


      1 defmodule Mix.Tasks.Scan do
      2   use Mix.Task
      3 
      4   def run(_) do
      5     Application.ensure_all_started(:clairvoyance)
      6     settings = Application.get_env(:clairvoyance, Clairvoyance.Log)
      7 
      8     result =
      9       Clairvoyance.scan()
     10       |> Jason.encode!()
     11 
     12     File.write(
     13       Keyword.get(settings, :path),
     14       result <> "\n",
     15       Keyword.get(settings, :modes)
     16     )
     17   end
     18 end