hansva commented on code in PR #8984:
URL: https://github.com/apache/hop/pull/8984#discussion_r4311859915


##########
plugins/actions/deletefolders/src/main/java/org/apache/hop/workflow/actions/deletefolders/ActionDeleteFolders.java:
##########
@@ -337,6 +375,32 @@ public List<ResourceReference> getResourceDependencies(
     return references;
   }
 
+  /**
+   * Hop stores the workflow directory in {@code 
Internal.Entry.Current.Folder}. Workflows carried
+   * over from Kettle still reference {@code Internal.Entry.Current.Directory}.
+   */
+  private String resolveFolderName(String rawName, IVariables space) {
+    if (rawName == null) {
+      return "";
+    }
+    IVariables source = space != null ? space : getVariables();
+    if (source == null) {
+      return rawName;
+    }
+    String resolved = source.resolve(rawName);
+    final String legacy = "${Internal.Entry.Current.Directory}";
+    if (resolved.contains(legacy)) {
+      String currentFolder = 
source.getVariable(Const.INTERNAL_VARIABLE_ENTRY_CURRENT_FOLDER);
+      if (Utils.isEmpty(currentFolder)) {
+        currentFolder = 
source.getVariable(Const.INTERNAL_VARIABLE_WORKFLOW_FILENAME_FOLDER);
+      }
+      if (!Utils.isEmpty(currentFolder)) {
+        resolved = resolved.replace(legacy, currentFolder);
+      }
+    }
+    return resolved;
+  }
+

Review Comment:
   I'm not a big fan of this change, the importer correctly changes these 
internal variables.
   The user should just fix this in stead of relying on a hack



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