Project

General

Profile

« Previous | Next » 

Revision 9310

lib/sh/util.sh: canon_rel_path(): use $PWD instead of the slower $(pwd -P) now that $PWD has symlinks expanded

View differences:

util.sh
276 276
cd -P . # expand symlinks in $PWD so it matches the output of realpath
277 277
# do before setting $top_script_abs so realpath has less symlinks to resolve
278 278

  
279
canon_rel_path() { base_dir="$(pwd -P)" path="$(realpath "$1")" rel_path; }
279
canon_rel_path() { base_dir="$PWD" path="$(realpath "$1")" rel_path; }
280 280

  
281 281
# makes $1 a canon_rel_path if it's a filesystem path
282 282
alias cmd2rel_path="$(cat <<'EOF'

Also available in: Unified diff