Skip to content

Commit

Permalink
Sort warp points
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lewin committed Jun 5, 2020
1 parent 8b12c38 commit 0448f37
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ wd_add()
then
wd_remove $point > /dev/null
printf "%q:%s\n" "${point}" "${PWD/#$HOME/~}" >> $WD_CONFIG
if (whence sort >/dev/null); then
local config_tmp=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX")
# use 'cat' below to ensure we respect $WD_CONFIG as a symlink
sort -o "${config_tmp}" $WD_CONFIG && cat "${config_tmp}" > $WD_CONFIG && rm "${config_tmp}"
fi

wd_export_static_named_directories

Expand Down

0 comments on commit 0448f37

Please sign in to comment.