Skip to content

Commit

Permalink
Merge pull request #62 from shaicoleman/save-fixes
Browse files Browse the repository at this point in the history
Save fixes - Preserve symlinks and improved tmpfile generation
  • Loading branch information
mfaerevaag committed Oct 16, 2018
2 parents 7373e98 + dd30b64 commit 3cbc583
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wd.sh
Expand Up @@ -203,8 +203,9 @@ wd_remove()

if [[ ${points[$point]} != "" ]]
then
local config_tmp=$WD_CONFIG.tmp
if sed -n "/^${point}:.*$/!p" $WD_CONFIG > $config_tmp && mv $config_tmp $WD_CONFIG
local config_tmp=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX")
# Copy and delete in two steps in order to preserve symlinks
if sed -n "/^${point}:.*$/!p" $WD_CONFIG > $config_tmp && cp $config_tmp $WD_CONFIG && rm $config_tmp
then
wd_print_msg $WD_GREEN "Warp point removed"
else
Expand Down

0 comments on commit 3cbc583

Please sign in to comment.