diff --git a/example/config_example.dart b/example/config_example.dart index bed8886..57f02aa 100644 --- a/example/config_example.dart +++ b/example/config_example.dart @@ -17,12 +17,20 @@ void main() { try { final repoConfig = Config.open(path: '.git/config'); - print('All entries of repo config:'); + print('\nAll entries of repo config:'); final entries = repoConfig.getEntries(); for (final entry in entries.entries) { print('${entry.key}: ${entry.value}'); } + // Set value of config variable + repoConfig.setValue('core.variable', 'value'); + print( + '\nNew value for variable "core.variable": ${repoConfig.getValue('core.variable')}'); + + // Delete variable + repoConfig.deleteEntry('core.variable'); + repoConfig.close(); } catch (e) { print(e); @@ -33,7 +41,7 @@ void main() { try { final globalConfig = Config.global(); - // get value of config variable + // Get value of config variable. final userName = globalConfig.getValue('user.name'); print('\nUser Name from global config: $userName');