Skip to content

Commit

Permalink
Simplify bundler cache feature by calling chown inline in postCreateC…
Browse files Browse the repository at this point in the history
…ommand
  • Loading branch information
andrewn617 committed Oct 4, 2024
1 parent e0a7118 commit 073e4ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
4 changes: 2 additions & 2 deletions features/bundler-cache/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "bundler-cache",
"version": "1.0.0",
"version": "1.0.1",
"name": "Bundler cache",
"description": "Creates a volume for persisting the installed gems across different containers",
"containerEnv": {
Expand All @@ -13,5 +13,5 @@
"type": "volume"
}
],
"postCreateCommand": "/usr/local/share/bundler-data-permissions.sh"
"postCreateCommand": "sudo chown -R ${USER} /bundle"
}
17 changes: 1 addition & 16 deletions features/bundler-cache/install.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
#!/bin/sh

set -e

USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"

POST_CREATE_COMMAND_SCRIPT_PATH="/usr/local/share/bundler-data-permissions.sh"

tee "$POST_CREATE_COMMAND_SCRIPT_PATH" > /dev/null \
<< EOF
#!/bin/sh
set -e
sudo chown -R ${USERNAME} /bundle
EOF

chmod 755 "$POST_CREATE_COMMAND_SCRIPT_PATH"
# This is a no op

0 comments on commit 073e4ba

Please sign in to comment.