Skip to content

Commit

Permalink
add script to prune dual prebuilds pre staging platform
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Oct 3, 2024
1 parent 03df688 commit f08d3fe
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/prune-dual-prebuilds.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Localdrive from 'localdrive'
import { fileURLToPath } from 'url-file-url'
import path from 'path'

const drive = new Localdrive(path.join(fileURLToPath(import.meta.url), '../..'))

const prune = []
for await (const entry of drive.list('/')) {
if (!entry.key.endsWith('.bare')) continue
if (!(await drive.get(entry.key.replace(/\.bare$/, '.node')))) continue
prune.push(entry.key)
}

for (const key of prune) {
console.log('Pruning dual prebuild', key)
await drive.del(key)
}

0 comments on commit f08d3fe

Please sign in to comment.