mirror of
https://github.com/multipleof4/GitRight.git
synced 2026-02-04 02:47:57 +00:00
Refactor: Remove .gitkeep creation in createFolder
This commit is contained in:
@@ -222,9 +222,11 @@
|
|||||||
const name = prompt('Folder name:', 'new-folder');
|
const name = prompt('Folder name:', 'new-folder');
|
||||||
if (name) {
|
if (name) {
|
||||||
const newPath = this.currentPath ? `${this.currentPath}/${name}` : name;
|
const newPath = this.currentPath ? `${this.currentPath}/${name}` : name;
|
||||||
const keepPath = `${newPath}/.gitkeep`;
|
if (this.fileTree.some(i => i.path === newPath)) {
|
||||||
|
alert('Folder already exists, Meowster.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.fileTree.push({ path: newPath, type: 'tree', sha: null });
|
this.fileTree.push({ path: newPath, type: 'tree', sha: null });
|
||||||
this.trackChange('add', keepPath, null, null, 'blob');
|
|
||||||
}
|
}
|
||||||
this.contextMenu.show = false;
|
this.contextMenu.show = false;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user