-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbifrost-http-install
More file actions
executable file
·54 lines (47 loc) · 1.56 KB
/
Copy pathbifrost-http-install
File metadata and controls
executable file
·54 lines (47 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
################################################################################
#
# bifrost-http-install
#
# Install/Update Bifrost LLM Gateway for current user. This also works as a version manager.
#
# Homepage: https://www.getmaxim.ai/bifrost
#
# Usage:
# bifrost-http-install <version>
#
# Example:
# bifrost-http-install 1.7.1
# bifrost-http-install v1.7.1
#
# MIT License.
# Copyright (C) 2025 Nguyen Nhat Tung.
#
################################################################################
set -e
# Application info
PROGRAM_ID="bifrost-http"
PROGRAM_EXEC="bifrost-http"
# Shared library
CTXDIR="$(cd "$(dirname "$0")" && pwd)"
. "${CTXDIR}/shared/install-common.sh"
. "${CTXDIR}/shared/install-source.sh"
# Prepare environment
normalize_install_version "$1"
init_install_env "${PROGRAM_ID}" "${INSTALL_VERSION}"
# Download and install binaries
if [ ! -d "${INSTALL_TARGET}" ]; then
BIN_URI_AMD64="$(get_download_uri_amd64 "${PROGRAM_ID}" "${INSTALL_VERSION}")"
BIN_URI_ARM64="$(get_download_uri_arm64 "${PROGRAM_ID}" "${INSTALL_VERSION}")"
BIN_TMP_FILE="${TEMP_TARGET}.bin"
download_uri_per_arch "${BIN_URI_AMD64}" "${BIN_URI_ARM64}" "${BIN_TMP_FILE}"
create_dir "${TEMP_TARGET}"
make_executable "${BIN_TMP_FILE}"
move_item "${BIN_TMP_FILE}" "${TEMP_TARGET}/${PROGRAM_EXEC}"
move_item "${TEMP_TARGET}" "${INSTALL_TARGET}"
remove_item "${TEMP_TARGET}"
fi
# Finalize install
symlink_item_overwrite "${INSTALL_TARGET}" "${ACTIVE_TARGET}"
symlink_item_overwrite "${ACTIVE_TARGET}/${PROGRAM_EXEC}" "${SYSTEM_BIN_ROOT}/${PROGRAM_ID}"
finalize_install