mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 18:45:19 +03:00
28 lines
666 B
TypeScript
28 lines
666 B
TypeScript
|
#!/usr/bin/env -S tea -E
|
||
|
|
||
|
/*
|
||
|
---
|
||
|
args:
|
||
|
- deno
|
||
|
- run
|
||
|
- --allow-net
|
||
|
- --allow-read
|
||
|
- --allow-write={{ tea.prefix }}
|
||
|
- --import-map={{ srcroot }}/import-map.json
|
||
|
---
|
||
|
*/
|
||
|
|
||
|
import { parsePackageRequirement } from "types"
|
||
|
import useCellar from "hooks/useCellar.ts"
|
||
|
import repairLinks from "prefab/repair-links.ts"
|
||
|
|
||
|
const pkgs = Deno.args.map(parsePackageRequirement); console.verbose({ received: pkgs })
|
||
|
const { resolve } = useCellar()
|
||
|
|
||
|
for (const pkg of pkgs) {
|
||
|
console.info({ uninstalling: pkg })
|
||
|
const installation = await resolve(pkg)
|
||
|
installation.path.rm({ recursive: true })
|
||
|
await repairLinks(pkg.project) //FIXME this is overkill, be precise
|
||
|
}
|