Created
November 12, 2014 18:08
-
-
Save pajp/214deae2821b27916191 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp_dmg() { | |
dmg="$1" | |
file="$2" | |
destination="$3" | |
mountpoint=$(hdiutil attach "$dmg" -nobrowse -plist|xpath '//key[.="mount-point"]/following-sibling::*[1]' 2> /dev/null|sed -e 's/<\/*string>//g') | |
cp "${mountpoint}/$file" "$destination" | |
hdiutil detach -quiet "$mountpoint" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment