allow a relative symlink to vimpager to work again#193
Merged
rkitover merged 2 commits intorkitover:masterfrom Jun 15, 2016
Merged
allow a relative symlink to vimpager to work again#193rkitover merged 2 commits intorkitover:masterfrom
rkitover merged 2 commits intorkitover:masterfrom
Conversation
When using a relative symlink (e.g. `ln -s ../.vim/bundle/vimpager/vimpager vp`) to invoke `vimpager` or `vimcat`, the path to `prologue.sh` was being calculated relative to the symlink file itself rather than to the actual location of script. Also, we only need to perform this resolution on symlinks (i.e. `while [ -h "$link" ]; do`). (this worked prior to 1126ee)
vimcat
Outdated
| if expr "$new_link" : '/.*' > /dev/null; then | ||
| link="$new_link" | ||
| else | ||
| link="$(dirname $link)/$new_link" |
Collaborator
There was a problem hiding this comment.
Please do not use POSIX command substitution at this point (before sourcing prologue.sh). Only backticks. And please quote $link.
Contributor
Author
There was a problem hiding this comment.
Do you think it's worth adding a comment about that POSIX command substitution restriction?
Collaborator
There was a problem hiding this comment.
- command subtitution: replace POSIX notation with backtick notation - quotes: remove superfluous ones, add necessary ones
lucc
added a commit
that referenced
this pull request
Jun 10, 2016
Collaborator
Contributor
Author
|
@lucc Comments addressed. Let me know if there's anything else I should do (e.g. squash commits). Thanks for your help! |
Collaborator
|
I don't care wether you squash them or not. @rkitover From my point of view this can be merged. Also see my comment about tests above. |
Owner
|
@SethMilliken thank you very much for this. |
Contributor
Author
lucc
added a commit
that referenced
this pull request
Jun 16, 2016
lucc
added a commit
that referenced
this pull request
Jun 19, 2016
lucc
added a commit
that referenced
this pull request
Jun 20, 2016
lucc
added a commit
that referenced
this pull request
Jun 20, 2016
lucc
added a commit
that referenced
this pull request
Jun 20, 2016
lucc
added a commit
that referenced
this pull request
Jun 20, 2016
lucc
added a commit
that referenced
this pull request
Jun 20, 2016
lucc
added a commit
that referenced
this pull request
Jun 21, 2016
lucc
added a commit
that referenced
this pull request
Jun 22, 2016
lucc
added a commit
that referenced
this pull request
Jun 23, 2016
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.
When using a relative symlink (e.g.
ln -s ../.vim/bundle/vimpager/vimpager vp)to invoke
vimpagerorvimcat, the path toprologue.shwas beingcalculated relative to the symlink file itself rather than to the actual
location of script. Also, we only need to perform this resolution on
symlinks (i.e.
while [ -h "$link" ]; do).(this worked prior to 1126ee)