tangled
alpha
login
or
join now
zio.sh
/
atfile
37
fork
atom
๐ฆโ๐ฆ Store and retrieve files on the Atmosphere
37
fork
atom
overview
issues
3
pulls
pipelines
something-broke: fix MediaInfo version output not working
ducky.ws
5 months ago
106e411a
e40fb7d9
1/1
build.yaml
success
5s
+8
-3
1 changed file
expand all
collapse all
unified
split
src
commands
something_broke.sh
+8
-3
src/commands/something_broke.sh
···
19
19
function atfile.something_broke.print_prog_version() {
20
20
prog="$1"
21
21
version_arg="$2"
22
22
-
head="1"
23
23
-
22
22
+
head="$3"
23
23
+
24
24
+
[[ -z "$head" ]] && head="1"
24
25
[[ -z "$version_arg" ]] && version_arg="--version"
25
26
26
27
if [ -x "$(command -v "$prog")" ]; then
27
28
version_output="$(eval "$prog $version_arg 2>&1")"
28
28
-
echo -e "$version_output" | head -n $head | sed "s/$prog //g"
29
29
+
if [[ $head == 0 ]]; then
30
30
+
echo -e "$version_output"
31
31
+
else
32
32
+
echo -e "$version_output" | head -n "$head" | sed "s/$prog //g"
33
33
+
fi
29
34
else
30
35
echo "$prog_not_installed_placeholder"
31
36
fi