Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,14 @@ function Main {
if ($LASTEXITCODE) {
Die "Downloaded llama binary failed to run"
}
$BUILD = $LLAMA_VERSION -replace "^b", ""
if ("$Version" -notlike "*build $BUILD*") {
if ($LLAMA_VERSION -match "^b([0-9]+)$") {
$STAMP = "build $($Matches[1]),"
} elseif ($LLAMA_VERSION -match "^g([0-9a-f]+)$") {
$STAMP = "commit $($Matches[1]))"
} else {
Die "Invalid version: $LLAMA_VERSION"
}
if (!$Version.Contains($STAMP)) {
Die "Version mismatch: expected $LLAMA_VERSION, got $Version"
}
if (Test-Path "$INSTALL_DIR\llama.exe") {
Expand Down
8 changes: 7 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,14 @@ main() {
VERSION=$(~/.llama-app/llama version) || die \
"Downloaded llama binary failed to run"

case "$LLAMA_VERSION" in (b|g|b*[!0-9]*|g*[!0-9a-f]*) ;;
(b*) STAMP="build ${LLAMA_VERSION#b}," ;;
(g*) STAMP="commit ${LLAMA_VERSION#g})" ;;
esac
[ "$STAMP" ] || die "Invalid version: $LLAMA_VERSION"

case "$VERSION" in
(*"build ${LLAMA_VERSION#b}"*) ;;
(*"$STAMP"*) ;;
(*) die "Version mismatch: expected $LLAMA_VERSION, got $VERSION" ;;
esac

Expand Down
Loading