-
Notifications
You must be signed in to change notification settings - Fork 55
Unyek, to re-write the files from a yek file #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
https://github.com/codeinred/untree :) Quick suggestion here write in parallel (I think Deno knows not to overwhelm the OS with too many writes in parallel but worth testing with a huge number to make sure) |
There's a pattern :D Since it |
Something like this: async function unyekFile(yekPath: string): Promise<void> {
try {
const content = await Deno.readTextFile(yekPath);
const files = parseYekContent(content);
const groupedFiles = groupFilesByBasePath(files);
const results = await Promise.allSettled(
groupedFiles
.map(async ([basePath, fileGroup]) =>
combineFileParts(fileGroup.parts)
)
.map((combinedContent) =>
writeFileContent(basePath, combinedContent)
)
);
if (results.every((result) => result.status === "fulfilled")) {
console.log("All files written successfully");
} else {
console.error("Failed to write some files");
}
} catch (error) {
console.error(`Error processing yek file: ${error.message}`);
Deno.exit(1);
}
} Note that from |
Not really an issue, but posting in case someone else needs it.
I wanted an ... unyek, to un-serialise the files, so I made one
https://github.com/AntouanK/unyek
The text was updated successfully, but these errors were encountered: