Skip to content
Permalink
Browse files

Fix array sorting error on zsh

  • Loading branch information...
mjsteinbaugh committed Sep 11, 2019
1 parent 63c69f2 commit ea1defd9ee9e374bc0b0d29568dbbfc56557c049
Showing with 6 additions and 6 deletions.
  1. +2 −1 os/linux/bin/patch-bcbio
  2. +4 −5 shell/bash/functions/path.sh
@@ -1,10 +1,11 @@
#/usr/bin/env bash
set -Eeux -o pipefail

# shellcheck source=/dev/null
source "$(koopa header linux)"

# Patch bcbio installation.
# Updated 2019-07-17.
# Updated 2019-09-11.

# Locate bcbio git directory.
if [[ -z "${git_dir:-}" ]]
@@ -29,7 +29,7 @@ _koopa_bash_add_local_bins_to_path() {
# - https://stackoverflow.com/questions/23356779
# - https://stackoverflow.com/questions/7442417
#
# Modified 2019-06-17.
# Modified 2019-09-11.
_koopa_bash_find_local_bin_dirs() {
local array
local sorted
@@ -59,9 +59,8 @@ _koopa_bash_find_local_bin_dirs() {

# Sort the array.
# SC2207: Prefer mapfile or read -a to split command output.
# > sorted=($(sort <<<"${array[*]}"))
IFS=$'\n' mapfile -t array < <(sort <<<"${array[*]}")
unset IFS
# > IFS=$'\n' mapfile -t array < <(sort <<<"${array[*]}")
# > unset IFS

printf "%s\n" "${sorted[@]}"
printf "%s\n" "${array[@]}"
}

0 comments on commit ea1defd

Please sign in to comment.
You can’t perform that action at this time.