10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/hemera/source/xcode.rb', line 10
def self.clean
puts 'In order to clean complete,xcode will be quit'
`osascript -e 'quit app "Xcode"'`
path_command = 'defaults read ~/Library/Preferences/com.apple.dt.Xcode.plist IDECustomDerivedDataLocation'
Open3.popen3 path_command do |_, stdout, _, wait_thr|
path = wait_thr.value.success? ? stdout.read.to_s.split("\n")[0] : '~/Library/Developer/Xcode/DerivedData'
func = 'rm -rf'
command = "#{func} #{path}"
puts "#{path} cleaning, wait a moment please 😄"
system command
puts "Clean complete, 👍"
end
end
|