Skip to content

Commit

Permalink
Make parent_dir non-final
Browse files Browse the repository at this point in the history
  • Loading branch information
tanviash authored Oct 19, 2023
1 parent ea6278f commit 5f86e95
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ private static void executeCommand(final Widget source_widget, final ExecuteComm
// Resolve command relative to the source widget model (not 'top'!)
final DisplayModel widget_model = source_widget.getDisplayModel();
final String parent_file = widget_model.getUserData(DisplayModel.USER_DATA_INPUT_FILE);
final String parent_dir = ModelResourceUtil.getDirectory(parent_file);
String parent_dir = ModelResourceUtil.getDirectory(parent_file);

// Check if the parent_dir exists or is reachable. If not, use "." as the parent_dir.
File parentDirectory = new File(parent_dir);
if (!parentDirectory.exists() || !parentDirectory.isDirectory()) {
logger.log(Level.WARNING, "Parent directory {0} does not exist or is not reachable. Using current directory instead.", parent_dir);
logger.log(Level.WARNING, "Parent directory {0} does not exist or is not reachable. Using current directory instead to execute command.", parent_dir);
parent_dir = ".";
}
// Execute (this is already running on background thread)
Expand Down

0 comments on commit 5f86e95

Please sign in to comment.