File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,15 @@ cp -r "${source_dir}/dev" "${build_dir}"
4747# Instead of hardcoding the list of directories to copy, find pom.xml and then
4848# crawl back up to the top. GNU realpath has --relative-to but this does not
4949# work on macOS
50- for source_root in $( find " ${source_dir} " -not \( -path " ${source_dir} " /build -prune \) -type f -name pom.xml -exec python -c " import os.path; print(os.path.relpath('{}', '${source_dir} '))" \; |
51- awk -F/ ' {print $1}' |
52- sort -u) ; do
50+
51+ poms=$( find " ${source_dir} " -not \( -path " ${source_dir} " /build -prune \) -type f -name pom.xml)
52+ if [[ " $OSTYPE " == " darwin" ]]; then
53+ poms=$( echo " $poms " | xargs -n1 python -c " import os.path; print(os.path.relpath('{}', '${source_dir} '))" )
54+ else
55+ poms=$( echo " $poms " | xargs -n1 realpath -s --relative-to=" ${source_dir} " )
56+ fi
57+
58+ for source_root in $( echo " ${poms} " | awk -F/ ' {print $1}' | sort -u) ; do
5359 cp -r " ${source_dir} /${source_root} " " ${build_dir} "
5460done
5561
You can’t perform that action at this time.
0 commit comments