mac_setup 0.4.0 → 0.5.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 +4 -4
- data/lib/mac_setup/command_line_tools_installer.rb +30 -0
- data/lib/mac_setup/version.rb +1 -1
- data/lib/mac_setup.rb +2 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b4164b88ee595b2b679633fbe490f8a05ebfc2c
|
4
|
+
data.tar.gz: e6f32f9da703b75ab5fe49749395f82d5bf57a7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 213cef3713f6220d48b83de0fe1e79fd4a841087bdb4a9e09b4d72b1f7d476096085e1a585e75b127f77bc350e14286a628a688458ad743a4a96c91220f3bbee
|
7
|
+
data.tar.gz: d355fc2de21d560a8b536b0407e18002726e56aca2edcb6a2cbb1ccc3ec3f85e35c0a7e524fbda47fce45aa34dad696690b36dfd7facd3eb6da6116dc6b87f87
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require "fileutils"
|
2
|
+
|
3
|
+
require_relative "shell"
|
4
|
+
|
5
|
+
module MacSetup
|
6
|
+
class CommandLineToolsInstaller
|
7
|
+
BIN_PATH = "/Library/Developer/CommandLineTools/usr/bin/clang"
|
8
|
+
TMP_FILE = "/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"
|
9
|
+
|
10
|
+
def self.run
|
11
|
+
if File.exist?(BIN_PATH)
|
12
|
+
puts "Command Line Tools already installed. Skipping..."
|
13
|
+
else
|
14
|
+
install_clts
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.install_clts
|
19
|
+
puts "Installing Command Line Tools..."
|
20
|
+
FileUtils.touch(TMP_FILE)
|
21
|
+
Shell.run(%(softwareupdate -i "#{package_name}" -v))
|
22
|
+
FileUtils.rm_f(TMP_FILE)
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.package_name
|
26
|
+
response = Shell.run("softwareupdate -l")
|
27
|
+
response.match(/(Command.*$)/)[1]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/mac_setup/version.rb
CHANGED
data/lib/mac_setup.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "mac_setup/version"
|
2
2
|
require "mac_setup/configuration"
|
3
3
|
require "mac_setup/system_status"
|
4
|
+
require "mac_setup/command_line_tools_installer"
|
4
5
|
require "mac_setup/homebrew_installer"
|
5
6
|
require "mac_setup/git_repo_installer"
|
6
7
|
require "mac_setup/script_installer"
|
@@ -27,6 +28,7 @@ module MacSetup
|
|
27
28
|
end
|
28
29
|
|
29
30
|
def self.bootstrap(dotfiles_repo)
|
31
|
+
CommandLineToolsInstaller.run
|
30
32
|
GitRepoInstaller.install_repo(dotfiles_repo, DOTFILES_PATH)
|
31
33
|
SymlinkInstaller.install_dotfile("mac_setup")
|
32
34
|
HomebrewInstaller.run
|
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.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Wean
|
@@ -104,6 +104,7 @@ files:
|
|
104
104
|
- exe/mac_setup
|
105
105
|
- lib/mac_setup.rb
|
106
106
|
- lib/mac_setup/brewfile_installer.rb
|
107
|
+
- lib/mac_setup/command_line_tools_installer.rb
|
107
108
|
- lib/mac_setup/configuration.rb
|
108
109
|
- lib/mac_setup/git_repo_installer.rb
|
109
110
|
- lib/mac_setup/homebrew_installer.rb
|