bash-completion: various bash fixes
authorStéphane Cerveau <scerveau@collabora.com>
Fri, 26 Feb 2021 09:47:38 +0000 (10:47 +0100)
committerStéphane Cerveau <scerveau@collabora.com>
Wed, 3 Mar 2021 08:43:36 +0000 (09:43 +0100)
-d tests the folder which is existing but with .in file, so I prefered
the -f to test if the gst file was available which is not the case, so
it fallbacks on the pkg-config

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/766>

data/bash-completion/completions/gst-inspect-1.0
data/bash-completion/completions/gst-launch-1.0
data/bash-completion/helpers/gst.in

index 667e503..25391ae 100644 (file)
@@ -20,7 +20,7 @@
 
 _GST_HELPERDIR="${BASH_SOURCE[0]%/*}/../helpers"
 
-if [[ ! -d "$_GST_HELPERDIR"  ]]; then
+if [[ ! -f $_GST_HELPERDIR/gst ]]; then
        _GST_HELPERDIR="$(pkg-config --variable=bashhelpersdir gstreamer-1.0)"
 else
        _GST_HELPERDIR=`cd "$_GST_HELPERDIR"; pwd`
index 80ad34c..b678c86 100644 (file)
@@ -20,7 +20,7 @@
 
 _GST_HELPERDIR="${BASH_SOURCE[0]%/*}/../helpers"
 
-if [[ ! -d "$_GST_HELPERDIR" ]]; then
+if [[ ! -f $_GST_HELPERDIR/gst ]]; then
        _GST_HELPERDIR="$(pkg-config --variable=bashhelpersdir gstreamer-1.0)"
 else
        _GST_HELPERDIR=`cd "$_GST_HELPERDIR"; pwd`
index 42cfb26..03a50eb 100644 (file)
@@ -23,7 +23,7 @@ if [[ ! -x "$_GST_HELPER" ]]
 then
         helper="$(pkg-config --variable=helpersdir gstreamer-@GST_API_VERSION@)/gst-completion-helper"
 
-        if [ -x "$helper" ]
+        if [ -x "$helper" ]
         then
           _GST_HELPER=$helper
         fi