Change Git dart API

Use a class instead of a many functions. This way we avoid passing the
same arguments again and again.
This commit is contained in:
Vishesh Handa
2019-06-17 19:38:56 +02:00
parent b9cd8696c2
commit d653663a47
10 changed files with 158 additions and 176 deletions

View File

@ -34,13 +34,14 @@ Future migrateGitRepo({
print("Migrating " + file.path + " --> " + toPath);
await file.copy(toPath);
await gitAdd(toGitBaseFolder, fileName);
await gitCommit(
gitFolder: toGitBaseFolder,
var gitRepo = GitRepo(
folderName: toGitBaseFolder,
authorEmail: Settings.instance.gitAuthorEmail,
authorName: Settings.instance.gitAuthor,
message: "Added Journal Entry",
);
await gitRepo.add(fileName);
await gitRepo.commit(message: "Added Journal Entry");
}
print("migrateGitRepo: Done");
}