这是indexloc提供的服务,不要输入任何密码
Skip to content

fix: revert "chore: fix corepack wiring in integration tests" #10054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
2 changes: 1 addition & 1 deletion turborepo-tests/helpers/setup_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fi

"${TURBOREPO_TESTS_DIR}/helpers/copy_fixture.sh" "${TARGET_DIR}" "${FIXTURE_NAME}" "${TURBOREPO_TESTS_DIR}/integration/fixtures"
"${TURBOREPO_TESTS_DIR}/helpers/setup_git.sh" "${TARGET_DIR}"
. "${TURBOREPO_TESTS_DIR}/helpers/setup_package_manager.sh" "${TARGET_DIR}" "$PACKAGE_MANAGER"
"${TURBOREPO_TESTS_DIR}/helpers/setup_package_manager.sh" "${TARGET_DIR}" "$PACKAGE_MANAGER"
if $INSTALL_DEPS; then
"${TURBOREPO_TESTS_DIR}/helpers/install_deps.sh" "$PACKAGE_MANAGER"
fi
Expand Down
17 changes: 8 additions & 9 deletions turborepo-tests/helpers/setup_package_manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@ pkgManagerName="${pkgManager%%@*}"

# Set the corepack install directory to a temp directory (either prysk temp or provided dir).
# This will help isolate from the rest of the system, especially when running tests on a dev machine.
COREPACK_INSTALL_DIR="${PRYSK_TEMP:-$dir}/corepack"
if [[ "$OSTYPE" == "msys" ]]; then
# Ensure it's a POSIX path so that we can use it as a PATH entry (C:\... -> /c/...)
COREPACK_INSTALL_DIR="$(cygpath -au "$COREPACK_INSTALL_DIR")"
# Ensure corepack uses lowercase .cmd extensions, consistent with node's bundled npm
export PATHEXT="$(echo "$PATHEXT" | tr '[:upper:]' '[:lower:]')"
if [ "$PRYSK_TEMP" == "" ]; then
COREPACK_INSTALL_DIR="$dir/corepack"
mkdir -p "${COREPACK_INSTALL_DIR}"
export PATH=${COREPACK_INSTALL_DIR}:$PATH
else
COREPACK_INSTALL_DIR="${PRYSK_TEMP}/corepack"
mkdir -p "${COREPACK_INSTALL_DIR}"
export PATH=${COREPACK_INSTALL_DIR}:$PATH
fi
mkdir -p "${COREPACK_INSTALL_DIR}"
export PATH=${COREPACK_INSTALL_DIR}:$PATH


# Enable corepack so that the packageManager setting in package.json is respected.
corepack enable $pkgManagerName "--install-directory=${COREPACK_INSTALL_DIR}"
Expand Down
Loading