فهرست منبع

Meta: Make all pre-commit CI scripts work with Bash 3.2

This change makes all the pre-commit CI scripts runnable under Bash 3.2,
by replacing “mapfile” invocations in them code that first explicitly
creates an array, and then uses a while loop to populate the array.

Otherwise, without this change, the scripts all fail to run under Bash
3.2 — due to lack of support for “mapfile”.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/283

This also drops bash from the list of homebrew dependencies in the build
instructions — because with this change, homebrew bash (v4) is no longer
needed; things will now work with the Apple-provided bash (v3.2)
sideshowbarker 1 سال پیش
والد
کامیت
570814a31e
6فایلهای تغییر یافته به همراه21 افزوده شده و 6 حذف شده
  1. 1 1
      Documentation/BuildInstructionsLadybird.md
  2. 4 1
      Meta/lint-clang-format.sh
  3. 4 1
      Meta/lint-gn.sh
  4. 4 1
      Meta/lint-prettier.sh
  5. 4 1
      Meta/lint-python.sh
  6. 4 1
      Meta/lint-shell-scripts.sh

+ 1 - 1
Documentation/BuildInstructionsLadybird.md

@@ -107,7 +107,7 @@ Xcode 14 versions before 14.3 might crash while building ladybird. Xcode 14.3 or
 
 ```
 xcode-select --install
-brew install autoconf autoconf-archive automake cmake ffmpeg nasm ninja ccache pkg-config bash
+brew install autoconf autoconf-archive automake cmake ffmpeg nasm ninja ccache pkg-config
 ```
 
 If you also plan to use the Qt chrome on macOS:

+ 4 - 1
Meta/lint-clang-format.sh

@@ -6,7 +6,10 @@ script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
 cd "${script_path}/.." || exit 1
 
 if [ "$#" -eq "1" ]; then
-    mapfile -t files < <(
+    files=()
+    while IFS= read -r file; do
+        files+=("$file")
+    done < <(
         git ls-files -- \
             '*.cpp' \
             '*.h' \

+ 4 - 1
Meta/lint-gn.sh

@@ -6,7 +6,10 @@ script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
 cd "${script_path}/.." || exit 1
 
 if [ "$#" -eq "0" ]; then
-    mapfile -t files < <(
+    files=()
+    while IFS= read -r file; do
+        files+=("$file")
+    done < <(
         git ls-files '*.gn' '*.gni'
     )
 else

+ 4 - 1
Meta/lint-prettier.sh

@@ -6,7 +6,10 @@ script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
 cd "${script_path}/.." || exit 1
 
 if [ "$#" -eq "0" ]; then
-    mapfile -t files < <(
+    files=()
+    while IFS= read -r file; do
+        files+=("$file")
+    done < <(
         git ls-files \
             --exclude-from .prettierignore \
             -- \

+ 4 - 1
Meta/lint-python.sh

@@ -6,7 +6,10 @@ script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
 cd "${script_path}/.." || exit 1
 
 if [ "$#" -eq "0" ]; then
-    mapfile -t files < <(
+    files=()
+    while IFS= read -r file; do
+        files+=("$file")
+    done <  <(
         git ls-files '*.py'
     )
 else

+ 4 - 1
Meta/lint-shell-scripts.sh

@@ -6,7 +6,10 @@ script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
 cd "$script_path/.."
 
 if [ "$#" -eq "0" ]; then
-    mapfile -t files < <(
+    files=()
+    while IFS= read -r file; do
+        files+=("$file")
+    done <  <(
         git ls-files -- \
             '*.sh' \
     )