Skip to content

Commit 3efbdf7

Browse files
authored
Merge pull request #86 from kohanyirobert/fix/playwright-npx-path
fix: source nvm in playwright install script so npx is on PATH
2 parents a8c9ad9 + 07a4adb commit 3efbdf7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/playwright/install.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
set -e
44

5+
# Source nvm so npx is available during feature installation
6+
# (containerEnv PATH additions from the node feature don't apply to install scripts)
7+
export NVM_DIR="${NVM_DIR:-/usr/local/share/nvm}"
8+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
9+
510
# Install Playwright browsers
611
# If _REMOTE_USER is set and not root, install as that user
712
# Otherwise install as root (test scenarios)
813
if [ -n "${_REMOTE_USER}" ] && [ "${_REMOTE_USER}" != "root" ] && id -u "${_REMOTE_USER}" > /dev/null 2>&1; then
9-
su "${_REMOTE_USER}" -c "npx playwright install --with-deps ${BROWSERS}"
14+
su "${_REMOTE_USER}" -c "export NVM_DIR=\"${NVM_DIR}\"; [ -s \"\$NVM_DIR/nvm.sh\" ] && . \"\$NVM_DIR/nvm.sh\"; npx playwright install --with-deps ${BROWSERS}"
1015
else
1116
npx playwright install --with-deps ${BROWSERS}
1217
fi

0 commit comments

Comments
 (0)