tballison commented on code in PR #2837:
URL: https://github.com/apache/tika/pull/2837#discussion_r3310961065


##########
tika-pipes/tika-async-cli/src/main/java/org/apache/tika/async/cli/PluginsWriter.java:
##########
@@ -43,50 +43,35 @@ public PluginsWriter(SimpleAsyncConfig simpleAsyncConfig, 
Path pluginsConfig) {
     }
 
     void write(Path output) throws IOException {
-        Path baseInput = StringUtils.isBlank(simpleAsyncConfig.getInputDir())
-                ? Paths.get(".").toAbsolutePath()
-                : Paths.get(simpleAsyncConfig.getInputDir());
-        Path baseOutput = StringUtils.isBlank(simpleAsyncConfig.getOutputDir())
-                ? null
-                : Paths.get(simpleAsyncConfig.getOutputDir());
-        if (Files.isRegularFile(baseInput)) {
+        boolean userConfigProvided = 
!StringUtils.isBlank(simpleAsyncConfig.getTikaConfig());
+        boolean inputExplicit = 
!StringUtils.isBlank(simpleAsyncConfig.getInputDir());
+        boolean outputExplicit = 
!StringUtils.isBlank(simpleAsyncConfig.getOutputDir());
+
+        // Resolve baseInput. If -i is explicit, use it. If not and the user
+        // didn't supply --config, fall back to '.' so the template's
+        // FETCHER_BASE_PATH placeholder gets a sane default. If --config is
+        // supplied and -i isn't, baseInput stays null so we don't trample the
+        // user's own basePath values.
+        Path baseInput = null;
+        if (inputExplicit) {
+            baseInput = Paths.get(simpleAsyncConfig.getInputDir());
+        } else if (!userConfigProvided) {

Review Comment:
   good catch



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to