Packages

LowEndInsight is a simple 'bus-factor' risk analysis library for Open Source Software which is managed within a Git repository. Provide the git URL and the library will respond with a basic Elixir Map structure report.

Current section

Files

Jump to
lowendinsight lib mix tasks batch_bulk_analyze.ex
Raw

lib/mix/tasks/batch_bulk_analyze.ex

defmodule Mix.Tasks.Lei.BatchBulkAnalyze do
use Mix.Task
def run(args) do
{:ok, file} = File.read(args)
String.split(file, "\n")
|> Enum.chunk_every(1000)
|> Enum.each(fn x ->
File.write("temp.txt", List.to_string(Enum.map(x, fn a -> a <> "\n" end)))
Mix.Tasks.Lei.BulkAnalyze.run(["temp.txt"])
end)
File.rm("temp.txt")
end
end