[WIP] u3d/installation: add feature to create shortcuts#336
Open
niezbop wants to merge 7 commits intoDragonBox:masterfrom
Open
[WIP] u3d/installation: add feature to create shortcuts#336niezbop wants to merge 7 commits intoDragonBox:masterfrom
niezbop wants to merge 7 commits intoDragonBox:masterfrom
Conversation
da171f8 to
ed3dce4
Compare
4 tasks
Member
|
Some questions
More comments in the review itself. |
lacostej
requested changes
Jan 8, 2019
| spec.add_dependency 'inifile', '>= 3.0.0', '< 4.0.0' # Parses INI files | ||
| spec.add_dependency 'plist', '>= 3.1.0', '< 4.0.0' # Generate the Xcode config plist file | ||
| spec.add_dependency 'security', '= 0.1.3' # macOS Keychain manager, a dead project, no updates expected | ||
| spec.add_dependency 'win32-shortcut', '>= 0.3.0' |
Member
There was a problem hiding this comment.
see overall comment related to platform specific dependency.
|
|
||
| if File.exist? lnk_path | ||
| UI.message "Shortcut already exists at #{lnk_path}" | ||
| return Win32::Shortcut.open(lnk_path) |
| c.syntax = 'u3d shortcuts [-u | --unity_version <version>] [-t | --target <folder>]' | ||
| c.option '-u', '--unity_version STRING', String, 'Creates a shortcut for this version of Unity only.' | ||
| c.option '-d', '--directory STRING', String, 'Specifies which directory to create the shortcuts in' | ||
| c.example 'Create a shortcut for all installed versions on the Desktop', 'u3d shortcuts -d ~/Desktop' |
Member
There was a problem hiding this comment.
is it risky to create shortcuts for all versions without specifying --all?
| end | ||
|
|
||
| shortcut = Win32::Shortcut.new(lnk_path) do |s| | ||
| s.description = "Shortcut to Unity.exe for Unity #{unity_version}. Automatically created by u3d." |
Member
There was a problem hiding this comment.
do we need to remove shortcuts when uninstalling?
| command :shortcuts do |c| | ||
| c.syntax = 'u3d shortcuts [-u | --unity_version <version>] [-t | --target <folder>]' | ||
| c.option '-u', '--unity_version STRING', String, 'Creates a shortcut for this version of Unity only.' | ||
| c.option '-d', '--directory STRING', String, 'Specifies which directory to create the shortcuts in' |
Member
There was a problem hiding this comment.
This seems optional. It should document where it creates the screenshot when it isn't passed.
| require 'win32-shortcut' | ||
| full_exe_path = File.expand_path(path_to_unity_exe) | ||
| lnk_parent = if target_directory.nil? | ||
| File.expand_path('..', full_exe_path) |
Member
There was a problem hiding this comment.
weird implementation of a default no?
Member
There was a problem hiding this comment.
shouldn't it be the desktop? In which case, should it be passed to the function (and let the caller define it).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
bundle exec rspecto make sure that my PR didn't break any testbundle exec rubocopto make sure that my PR is inline with our code stylePull Request Description
This brings a small QoL improvement which enables one to create shortcuts for his Unity installs in any directory.
Relies on the win32-shortcut gem.