File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /usr/ bin/env bash
22
3- set -e
3+ set -euo pipefail
44
5- USERNAME=${USERNAME:- ${_REMOTE_USER} }
5+ USERNAME=${USERNAME:- ${_REMOTE_USER:- } }
66FEATURE_ID=" shared-pnpm-store"
77STORE_DIR=" /mnt/shared-pnpm-store"
88LIFECYCLE_SCRIPTS_DIR=" /usr/local/share/${FEATURE_ID} /scripts"
99
1010echo " Ensuring pnpm store directory ${STORE_DIR} exists..."
1111mkdir -p " ${STORE_DIR} "
1212
13- if [ -n " ${USERNAME} " ] && [ " ${USERNAME} " != " root" ]; then
13+ if [[ -n " ${USERNAME} " && " ${USERNAME} " != " root" ] ]; then
1414 echo " Setting owner of ${STORE_DIR} to ${USERNAME} ..."
1515 chown -R " ${USERNAME} :${USERNAME} " " ${STORE_DIR} "
1616else
1717 echo " No non-root user; leaving ${STORE_DIR} owned by root."
1818fi
1919
2020# Install lifecycle script (re-asserts ownership at container create time)
21- if [ -f oncreate.sh ]; then
21+ if [[ -f oncreate.sh ] ]; then
2222 echo " Installing oncreate.sh to ${LIFECYCLE_SCRIPTS_DIR} ..."
2323 mkdir -p " ${LIFECYCLE_SCRIPTS_DIR} "
2424 cp oncreate.sh " ${LIFECYCLE_SCRIPTS_DIR} /oncreate.sh"
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /usr/ bin/env bash
22
3- set -e
3+ set -euo pipefail
44
55STORE_DIR=" /mnt/shared-pnpm-store"
66
@@ -9,7 +9,7 @@ STORE_DIR="/mnt/shared-pnpm-store"
99# ownership for the current non-root user on every container create so pnpm can
1010# always write to the store, even if the volume was first created by root or a
1111# different user.
12- if [ " $( id -u) " != " 0" ]; then
12+ if [[ " $( id -u) " != " 0" ] ]; then
1313 USERNAME=" $( id -un) "
1414 echo " Setting owner of ${STORE_DIR} to ${USERNAME} ..."
1515 sudo chown -R " ${USERNAME} :${USERNAME} " " ${STORE_DIR} "
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -e
3+ set -euo pipefail
44
55# Default assertions, reused by scenarios that have pnpm installed.
66# Not run directly as a scenario.
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -e
3+ set -euo pipefail
44
55# fish feature installed alongside
66./_default.sh
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -e
3+ set -euo pipefail
44
55# node feature v2 installs latest pnpm by default; this feature touches no
66# pnpm global state, so the default assertions are sufficient.
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -e
3+ set -euo pipefail
44
55# pnpm installed via the node feature
66./_default.sh
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -e
3+ set -euo pipefail
44
55source dev-container-features-test-lib
66
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -e
3+ set -euo pipefail
44
55# Optional: Import test library
66source dev-container-features-test-lib
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -e
3+ set -euo pipefail
44
55# pnpm already present in the base image
66./_default.sh
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -e
3+ set -euo pipefail
44
55# zsh configured as default shell
66./_default.sh
You can’t perform that action at this time.
0 commit comments