adamfeuer commented on a change in pull request #1382:
URL: https://github.com/apache/incubator-nuttx/pull/1382#discussion_r452619393



##########
File path: tools/checkrelease.sh
##########
@@ -19,114 +19,218 @@
 #
 #############################################################################
 
-set -e
-
+VERBOSE=0
+RETURN_CODE=0
 BASE_URL="https://dist.apache.org/repos/dist/dev/incubator/nuttx";
-TEMPDIR="dist.apache.org"
+DIST_DIR="dist.apache.org"
+TMP="/tmp"
+TEMPDIR="$TMP/nuttx-checkrelease"
 ORIGINAL_DIR="$(pwd)"
 trap "{ cd $ORIGINAL_DIR; rm -rf $TEMPDIR; }" EXIT
 
 function download_release() {
-    wget -r -np -R "index.html*" -P . --cut-dirs 7 "$URL"
+  rm -rf "$TEMPDIR"
+  if [[ -n "$URL" ]]; then
+    mkdir "$TEMPDIR"
+    wget -r --no-parent -P "$TEMPDIR" --cut-dirs 8 "$URL"
     cd "$TEMPDIR"
+    mv $DIST_DIR/apache-nuttx-* .
+  else
+    if [[ -n "$DIRECTORY" ]]; then
+      cp -r "$DIRECTORY" "$TEMPDIR"
+      cd "$TEMPDIR"
+    else
+      echo "One of --dir or --url is required!"
+      exit 1
+    fi
+  fi

Review comment:
       @xiaoxiang781216 I think I want to leave the code as is. I tried the 
`wget` command options you suggest, but they don't work exactly the same way 
that @btashton's do. Are you ok if we leave as-is?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to