This is an automated email from the ASF dual-hosted git repository.

qianzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit c8542db7e9ca149bee5a2c152a838069d6da3022
Author: Qian Zhang <[email protected]>
AuthorDate: Wed Apr 10 14:20:33 2019 +0800

    Allowed caller to specify output file name for curl fetcher plugin.
    
    Review: https://reviews.apache.org/r/70445
---
 src/uri/fetchers/curl.cpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/uri/fetchers/curl.cpp b/src/uri/fetchers/curl.cpp
index 4c5408a..1796620 100644
--- a/src/uri/fetchers/curl.cpp
+++ b/src/uri/fetchers/curl.cpp
@@ -106,9 +106,13 @@ Future<Nothing> CurlFetcherPlugin::fetch(
         directory + "': " + mkdir.error());
   }
 
-  // TODO(jieyu): Allow user to specify the name of the output file.
-  const string output =
-    path::join(directory, Path(path::from_uri(uri.path())).basename());
+  string output;
+  if (outputFileName.isSome()) {
+    output = path::join(directory, outputFileName.get());
+  } else {
+    output = path::join(directory, 
Path(path::from_uri(uri.path())).basename());
+  }
+
 #ifndef __WINDOWS__
   const string curl = "curl";
 #else

Reply via email to