writeAll method
Writes all files, keyed by bundle-relative path.
When checkOnly is true the filesystem is not changed; the returned
paths identify files that would be written.
Implementation
Future<OkfWriteResult> writeAll(
String rootPath,
Map<String, String> files, {
bool checkOnly = false,
}) async {
if (checkOnly) {
final root = await _validatedRoot(rootPath, createIfMissing: false);
return _writeAll(
root,
_normalizeFiles(files),
checkOnly: true,
);
}
await _createRootParent(rootPath);
return OkfBundleApplyLock.synchronized(rootPath, () async {
final root = await _validatedRoot(rootPath, createIfMissing: true);
return _writeAll(
root,
_normalizeFiles(files),
checkOnly: false,
);
});
}