Skip to content

Commit

Permalink
Fix ov corepack and pdm existence issues (#4472)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend authored Jun 13, 2024
1 parent f327d53 commit f262be5
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions docker/dev_env/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,30 @@ darwin*)
;;
esac

host_pnpm_store="$(pnpm store path 2>/dev/null || echo)"
if command -v pnpm &>/dev/null; then
host_pnpm_store="$(pnpm store path)"

# Share the pnpm cache with the container, if it's available locally
if [ "$host_pnpm_store" != "" ]; then
pnpm_home="$(dirname "$host_pnpm_store")"
run_args+=(
--env PNPM_HOME="$pnpm_home"
-v "$pnpm_home:$pnpm_home:rw,z"
)
# Share the pnpm cache with the container, if it's available locally
if [ "$host_pnpm_store" != "" ]; then
pnpm_home="$(dirname "$host_pnpm_store")"
run_args+=(
--env PNPM_HOME="$pnpm_home"
-v "$pnpm_home:$pnpm_home:rw,z"
)
fi
fi

# Share the PDM cache with the container, if it's available locally
# --quiet so PDM doesn't repeatedly fill the console with update messages
# if they're enabled
if [ "$(pdm config --quiet install.cache)" == "True" ]; then
host_pdm_cache="$(pdm config --quiet cache_dir)"
run_args+=(
--env "PDM_CACHE_DIR=$host_pdm_cache"
-v "$host_pdm_cache:$host_pdm_cache:rw,z"
)
if command -v pdm &>/dev/null; then
# Share the PDM cache with the container, if it's available locally
# --quiet so PDM doesn't repeatedly fill the console with update messages
# if they're enabled
if [ "$(pdm config --quiet install.cache)" == "True" ]; then
host_pdm_cache="$(pdm config --quiet cache_dir)"
run_args+=(
--env "PDM_CACHE_DIR=$host_pdm_cache"
-v "$host_pdm_cache:$host_pdm_cache:rw,z"
)
fi
fi

docker run "${run_args[@]}" openverse-dev-env:latest "$@"

0 comments on commit f262be5

Please sign in to comment.