Web Dev Solutions

Catalin Mititiuc

From 9e8392a939825a8920004922d51b123b1a92b6b9 Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Wed, 11 Dec 2024 16:59:15 -0800 Subject: Get path from config in mix task --- lib/pandoc.ex | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/pandoc.ex') diff --git a/lib/pandoc.ex b/lib/pandoc.ex index 57606da..882d772 100644 --- a/lib/pandoc.ex +++ b/lib/pandoc.ex @@ -23,7 +23,7 @@ defmodule Pandoc do end end - def run(profile, extra_args) do + def run(profile, path) do config = Application.get_env(:pandoc, profile) args = config[:args] || [] @@ -33,8 +33,6 @@ defmodule Pandoc do stderr_to_stdout: true ] - [path] = extra_args - args = List.update_at(args, -1, fn v -> Path.join( @@ -46,6 +44,6 @@ defmodule Pandoc do ) end) - "pandoc" |> System.cmd(args ++ extra_args, opts) |> elem(1) + "pandoc" |> System.cmd(args ++ [path], opts) |> elem(1) end end -- cgit v1.2.3