Skip to content

Commit

Permalink
Merge pull request #162 from lacostej/mac_install
Browse files Browse the repository at this point in the history
u3d/install: properly search for freshly installed versions on Mac (fixes #160)
  • Loading branch information
lacostej authored Oct 3, 2017
2 parents abca86a + 3803276 commit 102846b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/u3d/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def install_pkg(file_path, version: nil, target_path: nil)
destination_path = File.join(target_path, 'Applications', UNITY_DIR % version)
FileUtils.mv temp_path, destination_path
else
UI.verbose "Unity install for version #{version} found under #{unity.path}"
begin
path = File.expand_path('..', unity.path)
move_to_temp = (temp_path != path)
Expand All @@ -153,8 +154,9 @@ def install_pkg(file_path, version: nil, target_path: nil)
private

def list_installed_paths
find = File.join(DEFAULT_MAC_INSTALL, 'Unity*', 'Unity.app')
paths = Dir[find].map { |path| File.expand_path('..', path) }
find = File.join(DEFAULT_MAC_INSTALL, 'Applications', 'Unity*', 'Unity.app')
paths = Dir[find]
UI.verbose "Found list_installed_paths: #{paths}"
paths
end

Expand All @@ -171,6 +173,7 @@ def spotlight_installed_paths
cmd = "mdfind \"#{mdfind_args}\" 2>/dev/null"
UI.verbose cmd
paths = `#{cmd}`.split("\n")
UI.verbose "Found spotlight_installed_paths: #{paths}"
paths
end
end
Expand Down

0 comments on commit 102846b

Please sign in to comment.