aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2017-03-08 09:53:05 +0100
committerDaniel Lange <DLange@git.local>2017-03-08 11:12:49 +0100
commit1141563f92614564100b36b5c1a7ae71343cfebe (patch)
tree817e6774bc4d84688583e5e699ed2f5648e15e1a
parentc3df0643f56b8e1ce2a815ecda82a374ed394547 (diff)
downloadbitpocket-1141563f92614564100b36b5c1a7ae71343cfebe.zip
bitpocket-1141563f92614564100b36b5c1a7ae71343cfebe.tar.gz
bitpocket-1141563f92614564100b36b5c1a7ae71343cfebe.tar.bz2
Port Github PR #54 from sickill/bitpocketHEADmaster
Fix syncing files whose names start with . (dot).
-rwxr-xr-xbitpocket6
-rwxr-xr-xbitpocket_mac6
2 files changed, 6 insertions, 6 deletions
diff --git a/bitpocket b/bitpocket
index f1df649..e6d159f 100755
--- a/bitpocket
+++ b/bitpocket
@@ -137,7 +137,7 @@ function sync {
echo "# Saving current state and backing up files (if needed)"
echo " | Root dir: $(pwd)"
rsync -av --list-only --exclude "/$DOT_DIR" $RSYNC_OPTS $USER_RULES . | grep "^-\|^d" \
- | sed "s:^\S*\s*\S*\s*\S*\s*\S*\s*:/:" | sed "s:^/\.::" | sort > "$STATE_DIR/tree-current"
+ | sed "s:^\S*\s*\S*\s*\S*\s*\S*\s*:/:" | sed "s:^/\.$::" | sort > "$STATE_DIR/tree-current"
# Prevent bringing back locally deleted files or removing new local files
cp -f "$STATE_DIR/added-prev" "$TMP_DIR/fetch-exclude"
@@ -186,7 +186,7 @@ function sync {
echo
echo "# Saving after-sync state and cleaning up"
rsync -av --list-only --exclude "/$DOT_DIR" $USER_RULES . | grep "^-\|^d" \
- | sed "s:^\S*\s*\S*\s*\S*\s*\S*\s*:/:" | sed "s:^/\.::" | sort > "$TMP_DIR/tree-after"
+ | sed "s:^\S*\s*\S*\s*\S*\s*\S*\s*:/:" | sed "s:^/\.$::" | sort > "$TMP_DIR/tree-after"
# Save all newly created files for next run (to prevent deletion of them)
@@ -363,7 +363,7 @@ function die {
function list {
echo -e "\x1b\x5b1;32mbitpocket\x1b\x5b0m will sync the following files:"
rsync -av --list-only --exclude "/$DOT_DIR" $USER_RULES . | grep "^-\|^d" \
- | sed "s:^\S*\s*\S*\s*\S*\s*\S*\s*:/:" | sed "s:^/\.::" | sort
+ | sed "s:^\S*\s*\S*\s*\S*\s*\S*\s*:/:" | sed "s:^/\.$::" | sort
}
function usage {
diff --git a/bitpocket_mac b/bitpocket_mac
index 0101766..b3fc6e8 100755
--- a/bitpocket_mac
+++ b/bitpocket_mac
@@ -139,7 +139,7 @@ function sync {
echo "# Saving current state and backing up files (if needed)"
echo " | Root dir: $(gpwd)"
/usr/local/bin/rsync -av --list-only --exclude "/$DOT_DIR" $RSYNC_OPTS $USER_RULES . | grep "^-\|^d" \
- | gsed "s:^\S*\s*\S*\s*\S*\s*\S*\s*:/:" | gsed "s:^/\.::" | gsort > "$STATE_DIR/tree-current"
+ | gsed "s:^\S*\s*\S*\s*\S*\s*\S*\s*:/:" | gsed "s:^/\.$::" | gsort > "$STATE_DIR/tree-current"
# Prevent bringing back locally deleted files or removing new local files
gcp -f "$STATE_DIR/added-prev" "$TMP_DIR/fetch-exclude"
@@ -188,7 +188,7 @@ function sync {
echo
echo "# Saving after-sync state and cleaning up"
/usr/local/bin/rsync -av --list-only --exclude "/$DOT_DIR" $USER_RULES . | grep "^-\|^d" \
- | gsed "s:^\S*\s*\S*\s*\S*\s*\S*\s*:/:" | gsed "s:^/\.::" | gsort > "$TMP_DIR/tree-after"
+ | gsed "s:^\S*\s*\S*\s*\S*\s*\S*\s*:/:" | gsed "s:^/\.$::" | gsort > "$TMP_DIR/tree-after"
# Save all newly created files for next run (to prevent deletion of them)
@@ -365,7 +365,7 @@ function die {
function list {
echo -e "\x1b\x5b1;32mbitpocket\x1b\x5b0m will sync the following files:"
/usr/local/bin/rsync -av --list-only --exclude "/$DOT_DIR" $USER_RULES . | grep "^-\|^d" \
- | gsed "s:^\S*\s*\S*\s*\S*\s*\S*\s*:/:" | gsed "s:^/\.::" | gsort
+ | gsed "s:^\S*\s*\S*\s*\S*\s*\S*\s*:/:" | gsed "s:^/\.$::" | gsort
}
function usage {

© 2014-2020 Faster IT GmbH | imprint | privacy policy