diff options
| author | Teddy Wing | 2016-07-21 22:37:08 -0400 |
|---|---|---|
| committer | Teddy Wing | 2016-07-21 22:37:08 -0400 |
| commit | 4992f6d91962692a55c51498af55093c4905b98f (patch) | |
| tree | 7c7a8e012047a5be600dc4b56f43fc779482f8a6 | |
| parent | 48993ad34d2976f963f05ed9eaeed736b9668004 (diff) | |
| download | qcd-4992f6d91962692a55c51498af55093c4905b98f.tar.bz2 | |
qcd: Fix `absolute_path` function
This function wasn't correctly transforming paths into absolute paths.
Replace this with a different Stack Overflow solution, this time from
Ernest A:
http://stackoverflow.com/questions/4175264/retrieve-absolute-path-given-relative-linux-shell/20500246#20500246
(Modified to run in a subshell so we don't actually `cd`)
| -rwxr-xr-x | qcd | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -27,7 +27,7 @@ function setup () { } function absolute_path () { - (cd "$(dirname '$1')" &>/dev/null && printf "%s/%s" "$PWD" "${1##*/}") + (cd "$(dirname "$1")" && printf "%s/%s\n" "$(pwd)" "$(basename "$1")") } function shortcut_exists () { |
