saveGlobalConfig method

void saveGlobalConfig(
  1. GlobalConfig updater(
    1. GlobalConfig current
    )
)

Implementation

void saveGlobalConfig(GlobalConfig Function(GlobalConfig current) updater) {
  final didWrite = _saveConfigWithLock((current) {
    final config = updater(current);
    if (identical(config, current)) return current;
    // Remove project history during save
    _removeProjectHistory(config);
    return config;
  });

  if (didWrite) {
    _writeThroughCache(globalConfig.value);
  }
}