mirror of
https://github.com/DictXiong/dxsync.git
synced 2024-11-24 04:21:30 +08:00
fix for empty lines
This commit is contained in:
parent
71cfa14596
commit
718274af9d
9
sync.sh
9
sync.sh
|
@ -30,6 +30,9 @@ locked() {
|
|||
}
|
||||
|
||||
do_sync() {
|
||||
if [[ -z "$1" ]]; then
|
||||
return;
|
||||
fi
|
||||
local name="$1"
|
||||
local safe_name="${name//\//_}"
|
||||
local src="$2"
|
||||
|
@ -50,10 +53,14 @@ do_sync() {
|
|||
}
|
||||
|
||||
append_index() {
|
||||
if [[ -z "$1" ]]; then
|
||||
return;
|
||||
fi
|
||||
echo "$1" >> "$STATUS_INDEX"
|
||||
}
|
||||
|
||||
echo > "$STATUS_INDEX"
|
||||
rm "$STATUS_INDEX"
|
||||
touch "$STATUS_INDEX"
|
||||
while read p || [[ -n $p ]]; do
|
||||
append_index $p
|
||||
done < "$THIS_DIR"/config
|
||||
|
|
Loading…
Reference in New Issue
Block a user