feat(config): add api for config entry

This commit is contained in:
Aleksey Kulikov 2021-09-20 15:52:04 +03:00
parent cf677e488a
commit 7b8dfcc1af
6 changed files with 163 additions and 45 deletions

View file

@ -13,8 +13,8 @@ void main() async {
final config = Config.open();
print('All entries of system/global config:');
for (final entry in config.variables.entries) {
print('${entry.key}: ${entry.value}');
for (final entry in config) {
print('${entry.name}: ${entry.value}');
}
// free() should be called on object to free memory when done.
config.free();
@ -25,8 +25,8 @@ void main() async {
final repoConfig = Config.open('$tmpDir/.git/config');
print('\nAll entries of repo config:');
for (final entry in repoConfig.variables.entries) {
print('${entry.key}: ${entry.value}');
for (final entry in repoConfig) {
print('${entry.name}: ${entry.value}');
}
// Set value of config variable