mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
Fix issue with using a tmux version compiled source
Resolves #79. When tmux is compiled from source the version string is "master" which the tmux-version command didn't deal with correctly.
This commit is contained in:
@@ -44,7 +44,16 @@ vercomp () {
|
|||||||
version=$(tmux -V)
|
version=$(tmux -V)
|
||||||
version=${version/tmux /}
|
version=${version/tmux /}
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
|
echo "$version"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$version" == "master" ]; then
|
||||||
|
# When version string is "master", tmux was compiled from source, and we
|
||||||
|
# assume it's later than whatever the <target-version> is.
|
||||||
|
echo '>'
|
||||||
|
else
|
||||||
# Fix for "1.9a" version comparison, as vercomp() can only deal with
|
# Fix for "1.9a" version comparison, as vercomp() can only deal with
|
||||||
# purely numeric version numbers.
|
# purely numeric version numbers.
|
||||||
version=${version//+([a-zA-Z])/}
|
version=${version//+([a-zA-Z])/}
|
||||||
@@ -55,6 +64,4 @@ if [ -n "$1" ]; then
|
|||||||
1) echo '>';;
|
1) echo '>';;
|
||||||
2) echo '<';;
|
2) echo '<';;
|
||||||
esac
|
esac
|
||||||
else
|
|
||||||
echo "$version"
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user