Skip to content

Commit

Permalink
Use awk instead of sed just in case DEVELOPER_DIR contains meta chara…
Browse files Browse the repository at this point in the history
…cters of sed
  • Loading branch information
manicmaniac committed May 18, 2023
1 parent 331f1a8 commit 555ef2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Package/Scripts/preinstall
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ IFS='
' # newline
for old_rpath in $(get_rpaths "${INSTALLER_PAYLOAD_DIR}/usr/local/bin/xcnew")
do
new_rpath="$(echo "$old_rpath" | /usr/bin/sed -e "s|.*/Contents/Developer|$developer_dir|")"
new_rpath="$(echo "$old_rpath" | /usr/bin/awk -v developer_dir="$developer_dir" '{sub(".*/Contents/Developer", developer_dir); print}')"
/usr/bin/install_name_tool -rpath "$old_rpath" "$new_rpath" "${INSTALLER_PAYLOAD_DIR}/usr/local/bin/xcnew"
done

0 comments on commit 555ef2d

Please sign in to comment.