mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-15 07:56:11 +08:00
Add support for moving a Note to another folder
The Folder selection dialog needs a lot of work, but it's a start.
This commit is contained in:
@ -81,6 +81,19 @@ class GitNoteRepository {
|
||||
return NoteRepoResult(noteFilePath: newFullPath, error: false);
|
||||
}
|
||||
|
||||
Future<NoteRepoResult> moveNote(
|
||||
String oldFullPath,
|
||||
String newFullPath,
|
||||
) async {
|
||||
// FIXME: This is a hacky way of adding the changes, ideally we should be calling rm + add or something
|
||||
await _gitRepo.add(".");
|
||||
await _gitRepo.commit(
|
||||
message: "Note Moved",
|
||||
);
|
||||
|
||||
return NoteRepoResult(noteFilePath: newFullPath, error: false);
|
||||
}
|
||||
|
||||
Future<NoteRepoResult> removeNote(String noteFilePath) async {
|
||||
var pathSpec = noteFilePath.replaceFirst(gitDirPath, "").substring(1);
|
||||
|
||||
|
Reference in New Issue
Block a user