mac_setup 0.6.0 → 0.7.0

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: e838d025ff3bddf2160c37b063735b85094e7ff5
4
- data.tar.gz: 6c7d1722bbc01b83955fd73dd040e2b292460b1d
3
+ metadata.gz: d138f54b0282d08ae090d9d610449a01ca085ca8
4
+ data.tar.gz: e6c8f046d259c1716ddb3c2fa0b93b8ebdccf6aa
5
5
  SHA512:
6
- metadata.gz: 4792d51c9b5840513664182570c7de79c667641afba9aa0ac389db988a183705d129146f589214049c2d61a813a666ce5c2abe6322346011b7c51c526ff3f495
7
- data.tar.gz: 8708caa2c2c09d0fa8d3be474d9083a616174e93b404d5622418fe7e83b34704a0e79935d928528fec639d9d21fd2d388d67d8c6505d4eadc2da4d51f6caaa20
6
+ metadata.gz: aa607f339bdb85eeebebd20ae6e80d4d75dace9979b040d2226ead3947fbc91449785132b304e8caf5c2b768f9aee26bba1b6bdacd80c4fb760d8aedcb8d6783
7
+ data.tar.gz: 7652ec93fbfb92e1614ab32b7f5919bbb82b1c56296297b0de8244c7d3a7db19aff3432dc236b6078a9c8612baefd338840f42476046d90a7e8956d7dbc7f5b2
@@ -17,7 +17,7 @@ module MacSetup
17
17
 
18
18
  def run
19
19
  tap_bundle
20
- sign_in_to_mas
20
+ set_up_mas
21
21
  install_brewfile
22
22
  install_openssl
23
23
  end
@@ -30,16 +30,36 @@ module MacSetup
30
30
  Shell.run("brew tap #{BUNDLE_TAP}")
31
31
  end
32
32
 
33
- def sign_in_to_mas
33
+ def set_up_mas
34
+ brewfile = Pathname.new("~/.Brewfile").expand_path
34
35
  return unless brewfile.read =~ /^mas /
36
+
37
+ install_mas
38
+ sign_in_to_mas
39
+ end
40
+
41
+ def install_mas
42
+ Shell.run("brew install mas") unless mas_installed?
43
+ end
44
+
45
+ def sign_in_to_mas
46
+ return if mas_signed_in?
35
47
  apple_id = Shell.ask("What is your Apple ID?")
36
48
  Shell.run("mas signin --dialog #{apple_id}")
37
49
  end
38
50
 
51
+ def mas_signed_in?
52
+ Shell.success?("mas account")
53
+ end
54
+
39
55
  def install_brewfile
40
56
  Shell.run("brew bundle --global")
41
57
  end
42
58
 
59
+ def mas_installed?
60
+ Shell.success?("which mas")
61
+ end
62
+
43
63
  def install_openssl
44
64
  # Needed for encrypted files
45
65
  Shell.run("brew install openssl")
@@ -13,7 +13,7 @@ module MacSetup
13
13
  end
14
14
 
15
15
  def git_repos
16
- (@config["git_repos"] || []).uniq
16
+ ((@config["git_repos"] || []) + [@config["repo"]]).uniq
17
17
  end
18
18
 
19
19
  def symlinks
@@ -91,6 +91,7 @@ module MacSetup
91
91
 
92
92
  class SymlinkInstaller
93
93
  def self.run(config, _status)
94
+ Secrets.decrypt(DOTFILES_PATH)
94
95
  install_dotfiles
95
96
  install_symlinks(config)
96
97
  end
@@ -1,3 +1,3 @@
1
1
  module MacSetup
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
data/lib/mac_setup.rb CHANGED
@@ -24,7 +24,6 @@ module MacSetup
24
24
  def self.install(config_path, _options)
25
25
  config = Configuration.new(File.expand_path(config_path))
26
26
  status = SystemStatus.new
27
- Secrets.decrypt(DOTFILES_PATH)
28
27
 
29
28
  INSTALLERS.each { |installer| installer.run(config, status) }
30
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mac_setup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Wean