diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-05-29 15:27:38 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-05-29 15:27:38 -0300 |
commit | 366f528621e7d577106aa71c162f1c7d1472d7db (patch) | |
tree | 667ff5086bafcdf88046b6106ba1a360456839b2 /mvln | |
parent | b04072ea1c6979f17305ce3583dad347e2044dda (diff) | |
download | scripts-366f528621e7d577106aa71c162f1c7d1472d7db.tar.gz scripts-366f528621e7d577106aa71c162f1c7d1472d7db.tar.bz2 |
More mvln fixes
Diffstat (limited to 'mvln')
-rwxr-xr-x | mvln | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -8,16 +8,16 @@ # http://serverfault.com/questions/8108/move-a-file-and-leave-a-soft-link-behind # Parameters -ORIG="$1" -DEST="$2" BASE="$(basename "$1")" +ORIG="$(dirname "$1")" +DEST="$2" # Check -if [ ! -e "$1" ]; then - echo "File not found: $1" +if [ ! -e "$ORIG/$BASE" ]; then + echo "File not found: $ORIG/$BASE" exit 1 fi # Proceed mkdir -p "$DEST" -mv "$ORIG" "$DEST" && ln -s "$DEST/$BASE" "$ORIG" +mv "$ORIG/$BASE" "$DEST" && ln -s "$DEST/$BASE" "$ORIG/$BASE" |