Update generate-local.sh to work on both macOS and Linux. It seems cp -r behaves differently on Linux and macOS (verified on Arch and Ubuntu).
When running generate-locale.sh it ends up calling something along the lines of cp -rv ../src/2.18.1/ ../dst/2.18.1/ and creates ../dst/2.18.1/2.18.1 in ember-api-docs on Linux.
That behavior seems weird to me, and does not exist on Darwin/macOS. Seems to only happen with GNU cp.
# Bad behavior on Linux
$ rm -rf /tmp/{a,b}; mkdir -p /tmp/{a,b}/1; touch /tmp/a/1/test.txt; cp -rv /tmp/a/1/ /tmp/b/1/
'/tmp/a/1/' -> '/tmp/b/1/1'
'/tmp/a/1/test.txt' -> '/tmp/b/1/1/test.txt'
This can be fixed by using * to copy from the src.
Update
generate-local.sh
to work on both macOS and Linux. It seemscp -r
behaves differently on Linux and macOS (verified on Arch and Ubuntu).When running
generate-locale.sh
it ends up calling something along the lines ofcp -rv ../src/2.18.1/ ../dst/2.18.1/
and creates../dst/2.18.1/2.18.1
inember-api-docs
on Linux.That behavior seems weird to me, and does not exist on Darwin/macOS. Seems to only happen with GNU
cp
.This can be fixed by using
*
to copy from the src.I tested the updates on macOS (latest) and Arch and everything seems ok in my testing.