From 8994cfca0d90eebc43637ec7e1b6c280cc4a9aa2 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 27 May 2014 05:20:40 -0700 Subject: Finally commit the careful status bar install fix. --- Library/move.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Library') diff --git a/Library/move.sh b/Library/move.sh index 4a15ca7..c0fc10c 100755 --- a/Library/move.sh +++ b/Library/move.sh @@ -21,14 +21,20 @@ function mv_() { src=$1 mkdir -p /var/stash - dst=$(mktemp -d /var/stash/"${src##*/}".XXXXXX) + tmp=$(mktemp -d /var/stash/_.XXXXXX) + dst=${tmp}/${src##*/} + + mkdir -- "${dst}" || { + rmdir -- "${tmp}" + exit 1 + } if [[ -e ${src} ]]; then chmod --reference="${src}" "${dst}" chown --reference="${src}" "${dst}" cp -aT $v "${src}" "${dst}" || { - rm -rf "${dst}" + rm -rf "${tmp}" exit 1 } @@ -39,6 +45,7 @@ function mv_() { fi ln -s "${dst}" "${src}" + echo -n "${src}" >"${tmp}.lnk" } function shift_() { -- cgit v1.2.3