imgstat 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/utils.sh +25 -0
- package/package.json +1 -1
package/lib/utils.sh
CHANGED
|
@@ -4,7 +4,32 @@
|
|
|
4
4
|
require_command() {
|
|
5
5
|
local cmd="$1"
|
|
6
6
|
if ! command -v "$cmd" &> /dev/null; then
|
|
7
|
+
echo "" >&2
|
|
7
8
|
echo "Error: Required command '$cmd' is not installed." >&2
|
|
9
|
+
echo "" >&2
|
|
10
|
+
|
|
11
|
+
if [[ "$cmd" == "identify" ]]; then
|
|
12
|
+
echo "'identify' is part of ImageMagick. Install it with:" >&2
|
|
13
|
+
echo "" >&2
|
|
14
|
+
# Detect OS
|
|
15
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
16
|
+
echo " brew install imagemagick" >&2
|
|
17
|
+
elif command -v apt-get &>/dev/null; then
|
|
18
|
+
echo " sudo apt-get install imagemagick" >&2
|
|
19
|
+
elif command -v dnf &>/dev/null; then
|
|
20
|
+
echo " sudo dnf install imagemagick" >&2
|
|
21
|
+
elif command -v yum &>/dev/null; then
|
|
22
|
+
echo " sudo yum install imagemagick" >&2
|
|
23
|
+
elif command -v pacman &>/dev/null; then
|
|
24
|
+
echo " sudo pacman -S imagemagick" >&2
|
|
25
|
+
elif command -v apk &>/dev/null; then
|
|
26
|
+
echo " apk add imagemagick" >&2
|
|
27
|
+
else
|
|
28
|
+
echo " https://imagemagick.org/script/download.php" >&2
|
|
29
|
+
fi
|
|
30
|
+
echo "" >&2
|
|
31
|
+
fi
|
|
32
|
+
|
|
8
33
|
exit 1
|
|
9
34
|
fi
|
|
10
35
|
}
|