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