Skip to content

Commit

Permalink
use pwd -P instead of $PWD to avoid symlinks
Browse files Browse the repository at this point in the history
pwd -P gets the full, non-symlink path of the current directory which we can then walk up to the denv workspace - this should allow us to always mount the workspace directory as its full, real path
  • Loading branch information
tomeichlersmith authored Jul 28, 2023
1 parent ec60146 commit c31d26f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions denv
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ _denv_run() {
###################################################################################################

_denv_deduce_workspace() {
# start from PWD and go up directories until file .denv
# start from present working directory and go up directories until find .denv
# or reach root directory
denv_workspace="${PWD}"
denv_workspace="$(pwd -P || true)"
while [ "${denv_workspace}" != "/" ]; do
if [ -d "${denv_workspace}/.denv" ]; then
return 0
Expand Down

0 comments on commit c31d26f

Please sign in to comment.