Skip to content

Commit

Permalink
pass uniq arguments to cargo install
Browse files Browse the repository at this point in the history
  • Loading branch information
pysan3 committed Oct 22, 2023
1 parent 4774964 commit b3bd795
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion install_base.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ while IFS= read -r line; do
if [ 'x#' = x${line:0:1} ]; then continue; fi
command -v ${alt} &>/dev/null || pkg_list="$pkg_list $pkg"
done < "$DOTFILES/static/list_rust_packages.txt"
[[ -n "$pkg_list" ]] && checkyes "Execute: 'cargo install $pkg_list'?" && eval "cargo install $pkg_list 2>/dev/null &"
uniq_pkg_list=$(echo "$pkg_list" | sed 's/ /\n/g' | uniq | xargs)
[[ -n "$uniq_pkg_list" ]] && checkyes "Execute: 'cargo install $uniq_pkg_list'?" \
&& eval "cargo install $uniq_pkg_list"
while IFS= read -r line; do
if [ 'x#' = x${line:0:1} ]; then continue; fi
alt=$(cargo_list_line_parse 'alt' $line | cut -d ' ' -f 1)
Expand Down

0 comments on commit b3bd795

Please sign in to comment.