mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
Add files to empty repository (#1717)
It should also be possible to create new files in empty non-initiated repositories with the help of scm-manager/scm-editor-plugin/pull/39. So that the plugin can mount itself, a new endpoint was provided hereby. Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
This commit is contained in:
@@ -28,14 +28,14 @@ export const isRootPath = (path: string) => {
|
||||
};
|
||||
|
||||
export const isRootFile = (file: File) => {
|
||||
if (!file.directory) {
|
||||
if (!file?.directory) {
|
||||
return false;
|
||||
}
|
||||
return isRootPath(file.path);
|
||||
};
|
||||
|
||||
export const isEmptyDirectory = (file: File) => {
|
||||
if (!file.directory) {
|
||||
if (!file?.directory) {
|
||||
return false;
|
||||
}
|
||||
return (file._embedded?.children?.length || 0) === 0;
|
||||
|
||||
Reference in New Issue
Block a user