+openssl portable (#131)

This commit is contained in:
Max Howell 2022-09-13 17:53:12 -04:00 committed by GitHub
parent bbb2cf3024
commit 16678e8833
2 changed files with 49 additions and 1 deletions

View file

@ -81,7 +81,8 @@ export async function bottle({ path: kegdir, pkg }: Installation): Promise<Path>
const filelist = kegdir
.join(filesListName)
.write({
text: relativePaths.join("\n")
text: relativePaths.join("\n"),
force: true
})
const tarball = useCache().bottle(pkg)

47
scripts/ls-aws-s3.ts Executable file
View file

@ -0,0 +1,47 @@
#!/usr/bin/env -S tea -E
/*---
args:
- deno
- run
- --allow-env
- --allow-net
- --import-map={{ srcroot }}/import-map.json
---*/
import { S3 } from "s3"
const sortByModified = Deno.args.includes("-m")
const reverse = Deno.args.includes("-r")
const s3 = new S3({
accessKeyID: Deno.env.get("AWS_ACCESS_KEY_ID")!,
secretKey: Deno.env.get("AWS_SECRET_ACCESS_KEY")!,
region: "us-east-1",
})
const bucket = s3.getBucket(Deno.env.get("AWS_S3_BUCKET")!)
const output: FileInfo[] = []
for await(const obj of bucket.listAllObjects({ batchSize: 200 })) {
const { key, lastModified } = obj
if (!key?.match(/\.tar.gz$/)) { continue }
output.push({ key: key!, lastModified: lastModified! })
}
output.sort((a, b) => {
switch (sortByModified) {
case true: return a.lastModified.valueOf() - b.lastModified.valueOf()
case false: return a.key < b.key ? -1 : 1
}
})
if (reverse) { output.reverse() }
console.table(output)
interface FileInfo {
key: string
lastModified: Date
}