Browse Source

build.sh: take into account that sometimes no packages are created

Karsten Böddeker 6 years ago
parent
commit
0209aab13d
1 changed files with 3 additions and 3 deletions
  1. 3 3
      build.sh

+ 3 - 3
build.sh

@@ -251,10 +251,10 @@ if [ "${PUBLISH}" -eq "1" ]; then
 	fi
 
 	# copying packages to the server
-	if [ -d "${PACKAGES_DIR}" ]; then
+	PKG_SUB_DIR=$(find ${PACKAGES_DIR}/ -maxdepth 1 -name *${VERSION})
+	if [ -d "${PKG_SUB_DIR}" ]; then
 		progress "Copying packages ..."
-		PACKAGES_DIR=$(find ${PACKAGES_DIR}/ -maxdepth 1 -name *${VERSION})
-		rsync -rlutzc -e ssh ${PACKAGES_DIR}/ ${SRV_USER}@${SRV_URL}:${SRV_PATH}/${VERSION}/packages
+		rsync -rlutzc -e ssh ${PKG_SUB_DIR}/ ${SRV_USER}@${SRV_URL}:${SRV_PATH}/${VERSION}/packages
 		[ "$?" -eq "0" ] || abort "Failed to copy packages."
 	fi