diff --git a/lib/xcode/install.rb b/lib/xcode/install.rb index 0eefb97..3edc90f 100644 --- a/lib/xcode/install.rb +++ b/lib/xcode/install.rb @@ -225,7 +225,6 @@ def seedlist end def install_dmg(dmg_path, suffix = '', switch = true, clean = true) - prompt = "Please authenticate for Xcode installation.\nPassword: " xcode_path = "/Applications/Xcode#{suffix}.app" if dmg_path.extname == '.xip' @@ -233,9 +232,9 @@ def install_dmg(dmg_path, suffix = '', switch = true, clean = true) xcode_orig_path = File.join(Dir.pwd, 'Xcode.app') xcode_beta_path = File.join(Dir.pwd, 'Xcode-beta.app') if Pathname.new(xcode_orig_path).exist? - `sudo -p "#{prompt}" mv "#{xcode_orig_path}" "#{xcode_path}"` + `mv "#{xcode_orig_path}" "#{xcode_path}"` elsif Pathname.new(xcode_beta_path).exist? - `sudo -p "#{prompt}" mv "#{xcode_beta_path}" "#{xcode_path}"` + `mv "#{xcode_beta_path}" "#{xcode_path}"` else out = <<-HELP No `Xcode.app(or Xcode-beta.app)` found in XIP. Please remove #{dmg_path} if you @@ -260,14 +259,14 @@ def install_dmg(dmg_path, suffix = '', switch = true, clean = true) return end - `sudo -p "#{prompt}" ditto "#{source}" "#{xcode_path}"` + `ditto "#{source}" "#{xcode_path}"` `umount "/Volumes/Xcode"` end xcode = InstalledXcode.new(xcode_path) unless xcode.verify_integrity - `sudo rm -rf #{xcode_path}` + `rm -rf #{xcode_path}` return end @@ -276,8 +275,8 @@ def install_dmg(dmg_path, suffix = '', switch = true, clean = true) xcode.install_components if switch - `sudo rm -f #{SYMLINK_PATH}` unless current_symlink.nil? - `sudo ln -sf #{xcode_path} #{SYMLINK_PATH}` unless SYMLINK_PATH.exist? + `rm -f #{SYMLINK_PATH}` unless current_symlink.nil? + `ln -sf #{xcode_path} #{SYMLINK_PATH}` unless SYMLINK_PATH.exist? `sudo xcode-select --switch #{xcode_path}` puts `xcodebuild -version` @@ -330,8 +329,8 @@ def rm_list_cache def symlink(version) xcode = installed_versions.find { |x| x.version == version } - `sudo rm -f #{SYMLINK_PATH}` unless current_symlink.nil? - `sudo ln -sf #{xcode.path} #{SYMLINK_PATH}` unless xcode.nil? || SYMLINK_PATH.exist? + `rm -f #{SYMLINK_PATH}` unless current_symlink.nil? + `ln -sf #{xcode.path} #{SYMLINK_PATH}` unless xcode.nil? || SYMLINK_PATH.exist? end def symlinks_to diff --git a/lib/xcode/install/uninstall.rb b/lib/xcode/install/uninstall.rb index ec6c46f..70deb97 100644 --- a/lib/xcode/install/uninstall.rb +++ b/lib/xcode/install/uninstall.rb @@ -25,7 +25,7 @@ def run installed_path = @installer.installed_versions.find { |x| x.version == @version } return if installed_path.nil? || installed_path.path.nil? - `sudo rm -rf #{installed_path.path}` + `rm -rf #{installed_path.path}` return unless @installer.symlinks_to == installed_path.path newest_version = @installer.installed_versions.last