mirror of
https://github.com/karpathy/nanochat.git
synced 2026-04-01 13:15:21 +00:00
Merge 0bcda4ccb4 into 1cd94d768f
This commit is contained in:
commit
c8177411c1
|
|
@ -20,6 +20,26 @@ mkdir -p $NANOCHAT_BASE_DIR
|
|||
|
||||
# install uv (if not already installed)
|
||||
command -v uv &> /dev/null || curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
if ! command -v uv &> /dev/null; then
|
||||
# uv installation path is not in $PATH, add it. This code mimics what the
|
||||
# uv install script does to determine the install path.
|
||||
|
||||
if [ -n "${XDG_BIN_HOME:-}" ]; then
|
||||
_install_dir="$XDG_BIN_HOME"
|
||||
elif [ -n "${XDG_DATA_HOME:-}" ]; then
|
||||
_install_dir="$XDG_DATA_HOME/../bin"
|
||||
else
|
||||
if [ -n "${HOME:-}" ]; then
|
||||
_inferred_home="$HOME"
|
||||
elif [ -n "${USER:-}" ]; then
|
||||
_inferred_home=$(getent passwd "$USER" | cut -d: -f6)
|
||||
else
|
||||
_inferred_home=$(getent passwd "$(id -un)" | cut -d: -f6)
|
||||
fi
|
||||
_install_dir="$_inferred_home/.local/bin"
|
||||
fi
|
||||
export PATH="$_install_dir:$PATH"
|
||||
fi
|
||||
# create a .venv local virtual environment (if it doesn't exist)
|
||||
[ -d ".venv" ] || uv venv
|
||||
# install the repo dependencies
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user