Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

u3d/install: properly search for freshly installed versions on Mac (fixes #160) #162

Merged
merged 1 commit into from
Oct 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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