diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2014-05-27 05:20:40 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2014-05-27 05:20:40 -0700 |
commit | 8994cfca0d90eebc43637ec7e1b6c280cc4a9aa2 (patch) | |
tree | cdc51d4c59631c45820d7deff75ac084a2d8bd43 /Library | |
parent | 86631cc455af9d89ffac71610471829f72aa189f (diff) |
Finally commit the careful status bar install fix.
Diffstat (limited to 'Library')
-rwxr-xr-x | Library/move.sh | 11 |
1 files changed, 9 insertions, 2 deletions
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_() { |