save method
Persists the store (dir mode 700, file mode 600 on POSIX).
Implementation
Future<void> save() async {
final file = File(path(home: home));
final dir = file.parent;
if (!await dir.exists()) {
await dir.create(recursive: true);
await _chmod(dir.path, '700');
}
await file.writeAsString(
const JsonEncoder.withIndent(' ').convert({
'mounts': {for (final e in mounts.entries) e.key: e.value.toJson()},
}),
);
await _chmod(file.path, '600');
}