Skip to content

Commit

Permalink
tools: fix setup for directories with spaces (#33769)
Browse files Browse the repository at this point in the history
Now handles $DIR with spaces. Also fixes UV_BIN variable
  • Loading branch information
fishnux authored Oct 13, 2024
1 parent d96a042 commit 3dd127c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions tools/install_python_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -e
export PIP_DEFAULT_TIMEOUT=200

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
ROOT=$DIR/../
cd $ROOT
ROOT="$DIR"/../
cd "$ROOT"

# updating uv on macOS results in 403 sometimes
function update_uv() {
Expand All @@ -24,9 +24,9 @@ function update_uv() {
if ! command -v "uv" > /dev/null 2>&1; then
echo "installing uv..."
curl -LsSf https://astral.sh/uv/install.sh | sh
UV_BIN='$HOME/.cargo/env'
UV_BIN="$HOME/.cargo/env"
ADD_PATH_CMD=". \"$UV_BIN\""
eval $ADD_PATH_CMD
eval "$ADD_PATH_CMD"
fi

echo "updating uv..."
Expand All @@ -36,9 +36,9 @@ echo "installing python packages..."
uv sync --frozen --all-extras
source .venv/bin/activate

echo "PYTHONPATH=${PWD}" > $ROOT/.env
echo "PYTHONPATH=${PWD}" > "$ROOT"/.env
if [[ "$(uname)" == 'Darwin' ]]; then
echo "# msgq doesn't work on mac" >> $ROOT/.env
echo "export ZMQ=1" >> $ROOT/.env
echo "export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> $ROOT/.env
echo "# msgq doesn't work on mac" >> "$ROOT"/.env
echo "export ZMQ=1" >> "$ROOT"/.env
echo "export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> "$ROOT"/.env
fi
4 changes: 2 additions & 2 deletions tools/ubuntu_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

# NOTE: this is used in a docker build, so do not run any scripts here.

$DIR/install_ubuntu_dependencies.sh
$DIR/install_python_dependencies.sh
"$DIR"/install_ubuntu_dependencies.sh
"$DIR"/install_python_dependencies.sh

0 comments on commit 3dd127c

Please sign in to comment.