Skip to content

Commit ba0b8b9

Browse files
yedayakakinomyoga
andcommitted
fix(convert): Try calling magick, for IM7
In image magick 7 running `convert` prints a warning. Try running magick first. ``` WARNING: The convert command is deprecated in IMv7, use "magick" instead of "convert" or "magick convert" ``` Another alternative is to just swallow the warning from `convert`, but this seems a bit more future proof. Co-Authored-By: Koichi Murase <myoga.murase@gmail.com>
1 parent 89aa18b commit ba0b8b9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

completions/convert

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ _comp_cmd_convert__common_options()
4949
return
5050
;;
5151
-format)
52-
_comp_compgen_split -- "$(convert -list format | _comp_awk \
52+
# FIXME: We should probably accept the actual command being used
53+
# here and run that, instead of calling `magick` or `convert`
54+
# explicitly.
55+
# `magick` is the new way to call the command in ImageMagick 7
56+
_comp_compgen_split -- "$({
57+
magick -list format 2>/dev/null || convert -list format
58+
} | _comp_awk \
5359
'/ [r-][w-][+-] / { sub("[*]$","",$1); print tolower($1) }')"
5460
return
5561
;;

0 commit comments

Comments
 (0)