mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-09-19 12:32:26 +08:00
Add a .gitjournal.yaml file in a folder
This file will be added to save the settings of how we want that folder to behave. For example - default Editor, view, sorting mode, etc. This feature is currently disabled as it will only be a part of the pro mode.
This commit is contained in:
@ -7,6 +7,7 @@ import 'package:fimber/fimber.dart';
|
||||
import 'package:git_bindings/git_bindings.dart';
|
||||
|
||||
import 'package:gitjournal/core/note.dart';
|
||||
import 'package:gitjournal/core/notes_folder.dart';
|
||||
import 'package:gitjournal/core/notes_folder_fs.dart';
|
||||
import 'package:gitjournal/settings.dart';
|
||||
|
||||
@ -55,6 +56,18 @@ class GitNoteRepository {
|
||||
return NoteRepoResult(noteFilePath: folder.folderPath, error: false);
|
||||
}
|
||||
|
||||
Future<NoteRepoResult> addFolderConfig(NotesFolderConfig config) async {
|
||||
var pathSpec = config.folder.pathSpec();
|
||||
pathSpec = pathSpec.isNotEmpty ? pathSpec : '/';
|
||||
|
||||
await _gitRepo.add(".");
|
||||
await _gitRepo.commit(
|
||||
message: "Update folder config for $pathSpec",
|
||||
);
|
||||
|
||||
return NoteRepoResult(noteFilePath: config.folder.folderPath, error: false);
|
||||
}
|
||||
|
||||
Future<NoteRepoResult> renameFolder(
|
||||
String oldFullPath,
|
||||
String newFullPath,
|
||||
|
Reference in New Issue
Block a user