-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
49 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const cidBuffer = 'bafkreicnannsz4gqqk3ccfwfd3z2hfzonr63z3hgsplefgrmz37psay23y'; | ||
export const cidBuffer = 'bafkreih6hhv5m44xz6fhklhqhcpdgd3znrs6w5332trjxb3qz5ychjy4se' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
// import path from 'path'; | ||
// import { readdir, stat, copyFile, writeFile } from 'fs/promises'; | ||
import path from 'path'; | ||
import { readdir, stat, copyFile, writeFile } from 'fs/promises'; | ||
|
||
// // #TODO should be updated with current cache structure | ||
// #TODO should be updated with current cache structure | ||
|
||
// const directory = 'cache'; | ||
const directory = 'cache'; | ||
|
||
// const files = await readdir(directory); | ||
// const stats = await Promise.all( | ||
// files.map((file) => stat(path.join(directory, file))) | ||
// ); | ||
const files = await readdir(directory); | ||
const stats = await Promise.all( | ||
files.map((file) => stat(path.join(directory, file))) | ||
); | ||
|
||
// const filesToInclude = files.filter((x, i) => stats[i].size < 100_000_000); | ||
const filesToInclude = files.filter((x, i) => stats[i].size < 100_000_000); | ||
|
||
// for (let fileToInclude of filesToInclude) { | ||
// await copyFile(`cache/${fileToInclude}`, `cache_frontend/${fileToInclude}`); | ||
// } | ||
for (let fileToInclude of filesToInclude) { | ||
await copyFile(`cache/${fileToInclude}`, `cache_frontend/${fileToInclude}`); | ||
} | ||
|
||
// await writeFile( | ||
// 'cache_frontend/cache_list.json', | ||
// JSON.stringify(filesToInclude, null, 2) | ||
// ); | ||
await writeFile( | ||
'cache_frontend/cache_list.json', | ||
JSON.stringify(filesToInclude, null, 2) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters