fix copying logic
This commit is contained in:
parent
b306b0cc96
commit
650a8b373e
|
@ -42,7 +42,7 @@ checkout_branch() {
|
|||
}
|
||||
|
||||
copy_to_dest () {
|
||||
cp -r "${SRCDIR/*}" "${OUTDIR}"
|
||||
cp -r "${SRCDIR}/." "${OUTDIR}"
|
||||
}
|
||||
|
||||
update_publish() {
|
||||
|
@ -57,14 +57,18 @@ update_publish() {
|
|||
if [[ "$PUBONLY" == false ]]; then
|
||||
get_changes
|
||||
fi
|
||||
diff "${SRCDIR} ${OUTDIR}"
|
||||
local rc=$?
|
||||
if [[ $rc -eq 1 ]]; then
|
||||
if diff "${SRCDIR}" "${OUTDIR}" >/dev/null; then
|
||||
echo "No changes detected."
|
||||
else
|
||||
copy_to_dest
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
srcdirlen=${#SRCDIR}
|
||||
if [[ ${SRCDIR:(-1)} == '/' ]]; then
|
||||
SRCDIR=${SRCDIR:0:-1}
|
||||
fi
|
||||
if [[ -f "$FILE" ]]; then
|
||||
while read -r src out rem; do
|
||||
# use rem as dummy variable to guarantee out countains one word
|
||||
|
|
Loading…
Reference in New Issue