MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / copySqliteFileSet

Function copySqliteFileSet

apps/local/src/db/v1-v2-migration.ts:1126–1139  ·  view source on GitHub ↗
(source: string, target: string)

Source from the content-addressed store, hash-verified

1124};
1125
1126const copySqliteFileSet = (source: string, target: string): void => {
1127 removeSqliteFileSet(target);
1128 for (const suffix of fileSetSuffixes) {
1129 const from = `${source}${suffix}`;
1130 const to = `${target}${suffix}`;
1131 if (fs.existsSync(from)) {
1132 fs.copyFileSync(from, to);
1133 fsyncFileIfExists(to);
1134 } else {
1135 fs.rmSync(to, { force: true });
1136 }
1137 }
1138 fsyncDirectory(dirname(target));
1139};
1140
1141const removeSqliteFileSet = (path: string): void => {
1142 for (const suffix of fileSetSuffixes) fs.rmSync(`${path}${suffix}`, { force: true });

Callers 1

Calls 3

removeSqliteFileSetFunction · 0.85
fsyncFileIfExistsFunction · 0.85
fsyncDirectoryFunction · 0.85

Tested by

no test coverage detected