Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APFS clone for Xcode cloning #44

Closed
andrebraga opened this issue Jun 6, 2019 · 1 comment
Closed

APFS clone for Xcode cloning #44

andrebraga opened this issue Jun 6, 2019 · 1 comment

Comments

@andrebraga
Copy link

The copy option of install.sh to clone Xcode currently uses:

sudo cp -Rp "/Applications/Xcode.app" "/Applications/XcodeWithPlugins.app"

It would be really nice to use the -c flag on APFS volumes in order to perform a copy-on-write clone. It's faster and saves disk space.

According to man 1 cp:

-c copy files using clonefile(2)

stat -f "%Sd" /Applications/Xcode.app can be used to check the device name Xcode currently resides in. Skeletal test, probably not super efficient:

if [[ $(diskutil info $(stat -f "%Sd" /Applications/Xcode.app) | grep APFS | wc -l) -gt 0 ]]; then
    # use '-c'
else
    # use normal copy
fi
@alanhamlett
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants