diff --git a/Casks/zulu7.rb b/Casks/zulu7.rb index b472f07c9..f7f3fe67d 100644 --- a/Casks/zulu7.rb +++ b/Casks/zulu7.rb @@ -10,15 +10,20 @@ cask 'zulu7' do pkg "Double-Click to Install Zulu #{version.major}.pkg" postflight do - system '/usr/bin/sudo', '-E', '--', - '/bin/mv', '-f', '--', "/Library/Java/JavaVirtualMachines/zulu-#{version.major}.jdk", "/Library/Java/JavaVirtualMachines/zulu-#{version.before_comma}.jdk" - system '/usr/bin/sudo', '-E', '--', - '/bin/ln', '-nsf', '--', "/Library/Java/JavaVirtualMachines/zulu-#{version.before_comma}.jdk", "/Library/Java/JavaVirtualMachines/zulu-#{version.major}.jdk" + system_command '/bin/mv', + args: ['-f', '--', "/Library/Java/JavaVirtualMachines/zulu-#{version.major}.jdk", "/Library/Java/JavaVirtualMachines/zulu-#{version.before_comma}.jdk"], + sudo: true + system_command '/bin/ln', + args: ['-nsf', '--', "/Library/Java/JavaVirtualMachines/zulu-#{version.before_comma}.jdk", "/Library/Java/JavaVirtualMachines/zulu-#{version.major}.jdk"], + sudo: true + if MacOS.version <= :mavericks - system '/usr/bin/sudo', '-E', '--', - '/bin/rm', '-rf', '--', '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK' - system '/usr/bin/sudo', '-E', '--', - '/bin/ln', '-nsf', '--', "/Library/Java/JavaVirtualMachines/zulu-#{version.before_comma}.jdk/Contents", '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK' + system_command '/bin/rm', + args: ['-rf', '--', '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK'], + sudo: true + system_command '/bin/ln', + args: ['-nsf', '--', "/Library/Java/JavaVirtualMachines/zulu#{version.before_comma}.jdk/Contents", '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK'], + sudo: true end end