Skip to content

Commit

Permalink
Fix reading dependecies from Formula in macos
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Jun 23, 2024
1 parent 5c5c837 commit 771def1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/scripts/darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ add_library() {
IFS=' ' read -r -a deps_array <<<"$(brew deps --formula "$lib" | tr '\n' ' ')"
to_wait=()
for dep_name in "$lib" "${deps_array[@]}"; do
dep_name="$(basename "$dep_name")"
add_library_helper "$dep_name" "$cache_dir" &
to_wait+=($!)
done
Expand Down Expand Up @@ -166,8 +167,16 @@ setup_dependencies() {
add_brew_tap "$ext_tap"
for extension in "${extensions_array[@]}"; do
IFS=' ' read -r -a dependency_array <<<"$(get_dependencies "$extension")"
IFS=' ' read -r -a extension_array <<<"$(echo "${dependency_array[@]}" | grep -Eo "shivammathur[a-z\/]*@" | cut -d '/' -f 3 | sed 's/@//' | tr '\n' ' ')"
IFS=' ' read -r -a libraries_array <<<"${dependency_array[@]//shivammathur*/}"
libraries_array=()
extension_array=()
for item in "${dependency_array[@]}"; do
if ! [[ "$item" == *"shivammathur"* ]]; then
libraries_array+=("$item")
else
formula_name="$(basename "$item")"
grep -q AbstractPhpExtension "$tap_dir/$ext_tap/Formula/$formula_name.rb" && extension_array+=("$item") || libraries_array+=("$item")
fi
done
if [[ -n "${libraries_array[*]// /}" ]]; then
step_log "Setup libraries for $extension"
setup_libraries "$extension" "${libraries_array[@]}"
Expand Down

0 comments on commit 771def1

Please sign in to comment.