mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-11-30 03:08:01 +08:00
[Bug] [Task-plugin] ShellTask add the parentfolder exist check and create if not exit (#8526)
* check the parent dir exist and create it * fix lint Co-authored-by: ywang46 <ywang46@paypal.com>
This commit is contained in:
parent
3025f67d37
commit
dd1397aaed
@ -124,7 +124,8 @@ public class ShellTask extends AbstractTaskExecutor {
|
||||
taskExecutionContext.getExecutePath(),
|
||||
taskExecutionContext.getTaskAppId(), OSUtils.isWindows() ? "bat" : "sh");
|
||||
|
||||
Path path = new File(fileName).toPath();
|
||||
File file = new File(fileName);
|
||||
Path path = file.toPath();
|
||||
|
||||
if (Files.exists(path)) {
|
||||
return fileName;
|
||||
@ -143,6 +144,9 @@ public class ShellTask extends AbstractTaskExecutor {
|
||||
if (OSUtils.isWindows()) {
|
||||
Files.createFile(path);
|
||||
} else {
|
||||
if (!file.getParentFile().exists()){
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
Files.createFile(path, attr);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user