Project

General

Profile

« Previous | Next » 

Revision 9309

lib/sh/util.sh: expand symlinks in $PWD: moved it before canon_rel_path(), which will require it

View differences:

util.sh
273 273
	echo "$path"
274 274
}
275 275

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

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

  
278 281
# makes $1 a canon_rel_path if it's a filesystem path
......
391 394

  
392 395
#### paths
393 396

  
394
cd -P . # expand symlinks in $PWD so it matches the output of realpath
395
# do before setting $top_script_abs so realpath has less symlinks to resolve
396

  
397 397
top_script_abs="$(realpath "$0")"; echo_vars top_script_abs # outermost script
398 398
	# realpath this before doing any cd so this points to the right place
399 399

  

Also available in: Unified diff