xcode-install 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6a7ead8e362add2bbf5738284d738293203b985
4
- data.tar.gz: 14da9635b40e2ad6c83a2fa1272c99fda3f2cbe5
3
+ metadata.gz: 95ef7ef854f22068da4b6d17fbd0eeec9bd7083b
4
+ data.tar.gz: a2f55e7e0ae0110d06c2cfac22645e31d696b06e
5
5
  SHA512:
6
- metadata.gz: 8b81b941c3d34ec102d3f565dc3a098654deadcc2adeddfb77c860963a5af00d610d6d54d0deba1cbc80c9014bba5ac587755ba057b1053f6b8a81d82e78846b
7
- data.tar.gz: f832a860866c3069d4b319b737891d0a6a6fe726b4ffb4968fb7c7d56234d8dca6efaabe6681b961b4094c438a816c2527689ef042060101593d880733948c91
6
+ metadata.gz: 39598493738e22334ffee03e5c4e96cb3aac39d2cdb1640441a24a038f8e6cbf7a00c441783f6d44e83ec630cca68a51f45f0cc6ead5e59a6228fbb4aadf8d4a
7
+ data.tar.gz: 34467afe0c9238147e88bbd0e1e47a08c5537758688d09b01680c97004bc48b00e943f01d92766ed081217c1524e9faa519f4d4690c943131bd865aded32c984
data/lib/xcode/install.rb CHANGED
@@ -74,12 +74,26 @@ module XcodeInstall
74
74
  def install_dmg(dmg_path, suffix = '', switch = true, clean = true)
75
75
  archive_util = '/System/Library/CoreServices/Applications/Archive Utility.app/Contents/MacOS/Archive Utility'
76
76
  prompt = "Please authenticate for Xcode installation.\nPassword: "
77
- xcode_beta_path = dmg_path.dirname + 'Xcode-beta.app'
78
77
  xcode_path = "/Applications/Xcode#{suffix}.app"
79
78
 
80
79
  if dmg_path.extname == '.xip'
81
80
  `'#{archive_util}' #{dmg_path}`
82
- `sudo -p "#{prompt}" mv "#{xcode_beta_path}" "#{xcode_path}"`
81
+ xcode_orig_path = dmg_path.dirname + 'Xcode.app'
82
+ xcode_beta_path = dmg_path.dirname + 'Xcode-beta.app'
83
+ if Pathname.new(xcode_orig_path).exist?
84
+ `sudo -p "#{prompt}" mv "#{xcode_orig_path}" "#{xcode_path}"`
85
+ elsif Pathname.new(xcode_beta_path).exist?
86
+ `sudo -p "#{prompt}" mv "#{xcode_beta_path}" "#{xcode_path}"`
87
+ else
88
+ out = <<-HELP
89
+ No `Xcode.app(or Xcode-beta.app)` found in XIP. Please remove #{dmg_path} if you
90
+ suspect a corrupted download or run `xcversion update` to see if the version
91
+ you tried to install has been pulled by Apple. If none of this is true,
92
+ please open a new GH issue.
93
+ HELP
94
+ $stderr.puts out.tr("\n", ' ')
95
+ return
96
+ end
83
97
  else
84
98
  mount_dir = mount(dmg_path)
85
99
  source = Dir.glob(File.join(mount_dir, 'Xcode*.app')).first
@@ -1,3 +1,3 @@
1
1
  module XcodeInstall
2
- VERSION = '2.0.3'.freeze
2
+ VERSION = '2.0.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcode-install
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Bügling
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-07 00:00:00.000000000 Z
11
+ date: 2016-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide