Skip to content

Commit

Permalink
Fixed dmg installation failure if GNU tar is installed (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
shyiko committed Mar 30, 2016
1 parent 8126b71 commit 9c3cec0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions command/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,17 @@ func installFromDmg(source string, target string) error {
// oracle
[]string{"",
"if [ -f " + pkgdir + "/jdk*.pkg/Payload" + " ]; then " +
"tar xvf " + pkgdir + "/jdk*.pkg/Payload -C " + target +
"cd " + pkgdir + "/jdk*.pkg && " +
"cat Payload | gzip -d | cpio -i && " +
"mv Contents " + target + "/" +
"; fi"},

// apple
[]string{"",
"if [ -f " + pkgdir + "/JavaForOSX.pkg/Payload" + " ]; then " +
"tar xzf " + pkgdir + "/JavaForOSX.pkg/Payload -C " + pkgdir + " &&" +
"mv " + pkgdir + "/Library/Java/JavaVirtualMachines/*/Contents " + target + "/Contents" +
"cd " + pkgdir + "/JavaForOSX.pkg && " +
"cat Payload | gzip -d | cpio -i && " +
"mv Library/Java/JavaVirtualMachines/*/Contents " + target + "/" +
"; fi"},

[]string{"Unmounting " + source, "hdiutil unmount " + mountpoint},
Expand Down

0 comments on commit 9c3cec0

Please sign in to comment.