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

Fix menu selection when installed version not present #541

Merged
merged 1 commit into from Mar 29, 2019

Conversation

shadowspawn
Copy link
Collaborator

@shadowspawn shadowspawn commented Dec 4, 2018

Pull Request Template:

Describe what you did

Fixed menu selection when active node version is not present in list. (#292 #367 #400)

Removing prior work-around in PR #296 which blocked calling n rm on the active version, but that causes some confusion when people trying to uninstall. (#169 #327 #441)

How you did it

Added speech marks around variable dereference in prev/next called when moving menu selection up or down.

Deleted now unnecessary lines of code blocking removal of current version.

How to verify it doesn't effect the functionality of n

Code inspection (simple changes).
Verify menu selection still works using n.
Remove a cached version using n rm <version>.

If this solves an issue, please put issue in PR notes.

Solves #292 #367 #391 #400

If this solves an issue, please include the output of issue that had problems and then the fixed output from the same command.

$ n 4.9.1
$ n 8.14.0
$ rm -rf /usr/local/n/versions/node/8.14.0
$ n 
(hit up or down arrow)

usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]

    node/4.9.1

Menu selection works in this situation after fix. Hitting the up/down arrow from first display moves selected item to top/bottom version, with no error message displayed.

Squash any unnecessary commits to keep history clean as possible

Place description for the changelog in PR so we can tally all changes for any future release

Fix menu selection of cached node versions when active node version is not present in cache. Allow removal of active node version from cache.

@shadowspawn
Copy link
Collaborator Author

The active node version missing from the menu list can also happen when the active version of node was installed without using n.

@shadowspawn
Copy link
Collaborator Author

(PR #489 was fixing same issue but with a focus on the cause of the situation.)

@shadowspawn
Copy link
Collaborator Author

(PR #390 was fixing same issue, with trying nightly as the cause.)

@shadowspawn shadowspawn merged commit 1e98421 into tj:master Mar 29, 2019
@shadowspawn shadowspawn deleted the issue/262-rm branch March 29, 2019 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant