scrap.ts 403 B

123456789101112131415
  1. import { Storage } from "../src/core/storage"
  2. // read share id from args
  3. const args = process.argv.slice(2)
  4. if (args.length !== 1) {
  5. console.error("Usage: bun script/scrap.ts <shareID>")
  6. process.exit(1)
  7. }
  8. const shareID = args[0]
  9. await Storage.remove(["share", shareID])
  10. const list = await Storage.list({ prefix: ["share_data", shareID] })
  11. for (const item of list) {
  12. await Storage.remove(item)
  13. }