From ea1bf45f570ce74ad7303cc2fb5038357e52f66d Mon Sep 17 00:00:00 2001 From: Miccal Matthews Date: Tue, 24 Jan 2017 13:43:02 +0800 Subject: [PATCH] Update zulu7.rb (#3173) Update zulu7 to use `system_command`. --- Casks/zulu7.rb | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) 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