[glib: 2/4] update-pcre: Use a subshell to avoid `cd ..`




commit c7d2206df335f04ffec877ce8017cdf77371436e
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue Nov 17 14:22:41 2020 +0000

    update-pcre: Use a subshell to avoid `cd ..`
    
    Shellcheck warning SC2103.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 glib/update-pcre/update.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/glib/update-pcre/update.sh b/glib/update-pcre/update.sh
index 0e558dd5c..69d7f8aa7 100644
--- a/glib/update-pcre/update.sh
+++ b/glib/update-pcre/update.sh
@@ -43,7 +43,8 @@ cd pcre
 # the file and then distribute it with GRegex.
 echo "Generating pcre_chartables.c"
 cp -R "${PCRE}" tmp-build
-cd tmp-build
+(
+cd tmp-build || exit 1
 ./configure --enable-utf8 --enable-unicode-properties --disable-cpp > /dev/null
 make pcre_chartables.c > /dev/null
 cat > ../pcre_chartables.c << \EOF
@@ -52,7 +53,7 @@ cat > ../pcre_chartables.c << \EOF
  */
 EOF
 cat pcre_chartables.c >> ../pcre_chartables.c
-cd ..
+)
 rm -R tmp-build
 
 # Compiled C files.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]