浏览代码

More flexible directory parsing

Zachary Kotlarek 13 年之前
父节点
当前提交
074053b8ae
共有 1 个文件被更改,包括 2 次插入 和 1 次删除
  1. 2 1
      sync.sh

+ 2 - 1
sync.sh

@@ -25,7 +25,8 @@ fi
 
 # Allow usage with absolute local paths
 if [ "`echo "${SUB_DIR}" | head -c 1`" == '/' ]; then
-	SUB_DIR="`echo "${SUB_DIR}" | sed 's%^'"${BASE_LOCAL}"'/%%'`"
+	BASE_LOCAL="`dirname "${SUB_DIR}"`"
+	SUB_DIR="`basename "${SUB_DIR}"`"
 fi
 
 # Sanity checks