update_xcode_plugins 0.3.1 → 0.3.2

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: 2e767ffabb5cb7dccc100ddcff7e365b56636560
4
- data.tar.gz: a2dd49cef48631bbedb9cfee67f356345bd8e9f2
3
+ metadata.gz: e5ce0bbcfbf2d527792780fc1a3ae1f15c98abba
4
+ data.tar.gz: 13899945ad14710cb46c46f62db1e87a9527ee51
5
5
  SHA512:
6
- metadata.gz: 7fe9940f35a7b2f5046fa0f798755ae8605ad5fbb1d8fd95b437d5d348ac1ef422ad0674c0558a9991eef5e8dd27f3d04c85def87955c417afce88b055f943ce
7
- data.tar.gz: 653ee6beb3b56b8905b89cb534e828dee0f6a1947a900629428ff57b92f46ea11d72b05f23cce0596faf393aa56700e9154338086dc0291811c772ad552e7d2d
6
+ metadata.gz: cff0d8a41328ba10c57e4a6c317dd60baf3644bbbc3ea7df82abb87c8fd25fc359a1f23ee03e078124d3a24c6fd9709a696a5d182427fad5f4249c44e1ec0c5a
7
+ data.tar.gz: 9ca6de1c58a65f7104973e5e8f2b8c97b826f60a284ac2cb142b726a1741b7f2ae94089aa6758dd4fe294395a3bb812249cd07ce6c4fc6097543aefef0e4bc2f
data/README.md CHANGED
@@ -34,6 +34,12 @@ $ update_xcode_plugins --unsign
34
34
 
35
35
  ![](http://i.imgur.com/3044DnB.png)
36
36
 
37
+ If you need to unsign without creating a copy of Xcode, at your own risk, use the command:
38
+
39
+ ```shell
40
+ $ update_xcode_plugins --unsafe-unsign
41
+ ```
42
+
37
43
  ##### Other options
38
44
 
39
45
  For a dry run to see which plugins will be updated,
data/lib/cli.rb CHANGED
@@ -12,7 +12,11 @@ module CLI
12
12
  end
13
13
 
14
14
  def self.unsign_xcode?
15
- ARGV.include?('--unsign')
15
+ ARGV.include?('--unsign') || ARGV.include?('--unsafe-unsign')
16
+ end
17
+
18
+ def self.unsafe_unsign_xcode?
19
+ ARGV.include?('--unsafe-unsign')
16
20
  end
17
21
 
18
22
  def self.no_colors?
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class UpdateXcodePlugins
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  end
@@ -23,35 +23,38 @@ class XcodeUnsigner
23
23
  return
24
24
  else
25
25
  puts notice
26
+ puts copy_notice unless CLI.unsafe_unsign_xcode?
26
27
  end
27
28
 
28
29
  separator
29
30
 
30
- selection = Ask.list 'Choose which Xcode.app you would like to copy and unsign (use arrows)',
31
- ['Cancel', xcodes].flatten
31
+ selection = Ask.list prompt, ['Cancel', xcodes].flatten
32
32
  return unless selection && selection != 0
33
33
 
34
34
  xcode = xcodes[selection - 1]
35
35
 
36
36
  unsign_xcodebuild = Ask.confirm "Unsign xcodebuild too?"
37
37
 
38
- new_xcode_path = '/Applications/Xcode-unsigned.app'
39
- if Dir.exist?(new_xcode_path)
40
- error 'Xcode-unsigned.app already exists.'
41
- return
42
- end
38
+ if CLI.unsafe_unsign_xcode?
39
+ new_xcode = xcode
40
+ else
41
+ new_xcode_path = '/Applications/Xcode-unsigned.app'
42
+ if Dir.exist?(new_xcode_path)
43
+ error 'Xcode-unsigned.app already exists.'
44
+ return
45
+ end
43
46
 
44
- process 'Copying Xcode... (this might take a while)'
45
- FileUtils.cp_r(xcode.path, new_xcode_path)
47
+ process 'Copying Xcode... (this might take a while)'
48
+ FileUtils.cp_r(xcode.path, new_xcode_path)
49
+ new_xcode = Xcode.new(new_xcode_path)
50
+ end
46
51
 
47
52
  process 'Unsigning...'
48
- new_xcode = Xcode.new(new_xcode_path)
49
-
50
53
  if new_xcode.unsign_binary! &&
51
54
  (!unsign_xcodebuild || (unsign_xcodebuild && new_xcode.unsign_xcodebuild!))
52
55
  success 'Finished! 🎉'
53
56
  else
54
- error "Could not unsign Xcode-unsigned.app\n"\
57
+ error "Could not unsign #{File.basename(new_xcode.path)}\n"\
55
58
  'Create an issue on https://github.com/inket/update_xcode_plugins/issues'
56
59
  end
57
60
  end
@@ -63,11 +66,21 @@ class XcodeUnsigner
63
66
  'However, an unsigned Xcode presents security risks, '\
64
67
  'and will be untrusted by both Apple and your system.'.colorize(:red),
65
68
  'Please make sure that you have launched this version of Xcode at least '\
66
- 'once before unsigning.'.colorize(:red),
67
- '',
69
+ 'once before unsigning.'.colorize(:red)
70
+ ]
71
+ end
72
+
73
+ def self.copy_notice
74
+ [
68
75
  'We recommend keeping a signed version of Xcode, so this tool will:',
69
76
  '- Create a copy of Xcode.app called Xcode-unsigned.app (consider the disk space requirements)',
70
77
  '- Unsign Xcode-unsigned.app'
71
78
  ]
72
79
  end
80
+
81
+ def self.prompt
82
+ "Choose which Xcode.app you would like to "\
83
+ "#{CLI.unsafe_unsign_xcode? ? '' : 'copy and '}"\
84
+ "unsign (use arrows)"
85
+ end
73
86
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: update_xcode_plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mahdi Bchetnia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-02 00:00:00.000000000 Z
11
+ date: 2016-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize