logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: cf367fdbd53b50f4324a01ddabdc0520cd787321
parent 93ce7b0efbe57de3d458d1ad9cd88fcd76d63241
Author: Haelwenn <contact+git.pleroma.social@hacktivis.me>
Date:   Fri, 15 Jan 2021 04:44:58 +0000

Merge branch 'optimize-command_available' into 'develop'

Optimize Pleroma.Utils.command_available?/1

See merge request pleroma/pleroma!3254

Diffstat:

Mlib/pleroma/utils.ex5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/pleroma/utils.ex b/lib/pleroma/utils.ex @@ -30,7 +30,10 @@ defmodule Pleroma.Utils do """ @spec command_available?(String.t()) :: boolean() def command_available?(command) do - match?({_output, 0}, System.cmd("sh", ["-c", "command -v #{command}"])) + case :os.find_executable(String.to_charlist(command)) do + false -> false + _ -> true + end end @doc "creates the uniq temporary directory"