Skip to content

Commit

Permalink
ruby: run_with*.sh should use realpath for shared folder (#292)
Browse files Browse the repository at this point in the history
On macOS, the Docker app uses the canonical path (symlinks resolved) for
shared folders.

This prevents sharing the directory containing the ruby scripts if the
path of the current working directory contains any directory symlinks.

Use realpath instead of pwd in these scripts, falling back to using pwd
when realpath is not available.
  • Loading branch information
kohlschuetter authored Dec 27, 2023
1 parent 4dd315e commit dc26d00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ruby/run_with_jekyll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if ! docker inspect ruby_with_jekyll > /dev/null 2>&1; then
fi

docker run -it --rm --name jekyll \
--volume=$PWD:/srv/jekyll \
--volume="$(realpath 2>/dev/null || pwd)":/srv/jekyll \
-p 1234:1234 \
ruby_with_jekyll \
$1
2 changes: 1 addition & 1 deletion ruby/run_with_liquid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ if ! docker inspect ruby_with_liquid > /dev/null 2>&1; then
fi

docker run -it --rm --name liquid \
--volume=$PWD:/srv/liquid \
--volume="$(realpath 2>/dev/null || pwd)":/srv/liquid \
ruby_with_liquid \
$1

0 comments on commit dc26d00

Please sign in to comment.