The version of xargs that comes with macOS does not support the -d option, which means that the line in post-merge:
dirsToCheck="$(echo "$changedFiles" | xargs -d '\n' dirname | sort -u)"
when run on macOS causes the script to fail with
xargs: illegal option -- d
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S replsize]]
I'm not sure what the best fix is for this. It seems like the de-duping before searching for empty directories isn't really necessary anyway, as a directory can only be deleted once, and this reduces cross-platform compatibility.
The version of
xargsthat comes with macOS does not support the-doption, which means that the line inpost-merge:when run on macOS causes the script to fail with
I'm not sure what the best fix is for this. It seems like the de-duping before searching for empty directories isn't really necessary anyway, as a directory can only be deleted once, and this reduces cross-platform compatibility.