leehaut commented on code in PR #8984:
URL: https://github.com/apache/hop/pull/8984#discussion_r4314612962
##########
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:
Removed the ${Internal.Entry.Current.Directory} fallback. resolveFolderName
now only resolves variables. Workflows that still use the old name should be
updated by the importer or by the user.
--
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]