-
Notifications
You must be signed in to change notification settings - Fork 810
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
omf doctor
checks for fish & git versions
#280
Conversation
@@ -0,0 +1,3 @@ | |||
function omf.check.version -a min_version -a current_version | |||
test (echo "$min_version"\n"$current_version" | sort -V | head -n1) = "$min_version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sort -V
isn't portable. BSD and OS X sort doesn't have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function omf.check.version -a min_version -a current_version
set -l IFS .
echo $min_version | read -la min_chunks
echo $current_version | read -la current_chunks
set -l current_chunks_count (count $current_chunks)
for i in (seq (count $min_chunks))
set -l chunk 0
math "$i <= $current_chunks_count" >/dev/null ^&1
and set chunk $current_chunks[$i]
math "$min_chunks[$i] <= $chunk" >/dev/null ^&1
or return 1
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the current chunk count thing was because i couldn't figure out a way to make the array stuff happy when comparing, for example, min version 1.2.3 with current version 1.2.
any better ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... Right. So I need to add something like
uname -a | grep -qEv "os x|bsd"; or echo "goddammit" >&2
j/k. alternate version coming in a second
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my version comes up with the right answer when checking omf.check.version 3.11.0 3.11
… but i guess that's an edge case that'll probably never be needed :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I was just checking my changes when you posted your version, so I only saw it when the PR was already updated. Otherwise I might have used your code.
On the upside, after (/ if) my edge-case-failing code is merged, you can override it with yours and get proper credits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) I'm not worried about credit.
👍 |
Everyone OK with these minimum versions? |
Git 1.9.5 is more than 1 year old. Latest Fish release, 2.2, is 9.5 months old. So, yeah 👍 I think we're good to go. |
Minimum fish version: 2.2.0 Minimum git version: 1.9.5
Minimum fish version: 2.2.0
function -V
(--inherit-variable
) in omf.repoMinimum git version: 1.9.5
git -C
in omf.repogit --depth 1
in installergit --depth 1
for package install