Skip to content

Commit 25268f4

Browse files
committed
feat: create missing parent folders in files:put
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 6ae0e6b commit 25268f4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/files/lib/Command/Put.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ public function execute(InputInterface $input, OutputInterface $output): int {
6262
}
6363
stream_copy_to_stream($source, $target);
6464
} else {
65+
$parentPath = dirname($fileOutput);
66+
if (!$this->rootFolder->nodeExists($parentPath)) {
67+
$this->rootFolder->newFolder($parentPath);
68+
}
69+
6570
$this->rootFolder->newFile($fileOutput, $source);
6671
}
6772
return self::SUCCESS;

0 commit comments

Comments
 (0)