mirror of
https://github.com/ivabus/pantry
synced 2025-06-08 08:20:32 +03:00
tea/cli handles installation
This commit is contained in:
parent
55eb7dc5e4
commit
232d693f44
2 changed files with 0 additions and 55 deletions
|
@ -1,20 +0,0 @@
|
|||
#!/usr/bin/env -S tea -E
|
||||
|
||||
_="
|
||||
---
|
||||
args: /bin/sh
|
||||
---
|
||||
"
|
||||
|
||||
ROOTS=$(ls /opt/tea.xyz/var/pantry/projects)
|
||||
|
||||
for x in $ROOTS
|
||||
do
|
||||
if [ "X$x" = "X" ]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
rm -rf /opt/"$x"
|
||||
done
|
||||
|
||||
rm /opt/tea.xyz/var/www/*.tar.?z
|
|
@ -1,35 +0,0 @@
|
|||
#!/usr/bin/env -S tea -E
|
||||
|
||||
// returns all pantry entries as `[{ name, path }]`
|
||||
|
||||
/*---
|
||||
args:
|
||||
- deno
|
||||
- run
|
||||
- --allow-env
|
||||
- --allow-read
|
||||
- --allow-write
|
||||
- --import-map={{ srcroot }}/import-map.json
|
||||
- --allow-net
|
||||
- --allow-run
|
||||
---*/
|
||||
|
||||
import { lvl1 as link } from "prefab/link.ts"
|
||||
import install from "prefab/install.ts"
|
||||
import { parsePackageRequirement } from "types"
|
||||
import resolve from "prefab/resolve.ts"
|
||||
import useFlags from "hooks/useFlags.ts"
|
||||
|
||||
useFlags()
|
||||
|
||||
const pkgs = Deno.args.map(project => {
|
||||
const match = project.match(/projects\/(.+)\/package.yml/)
|
||||
return match ? match[1] : project
|
||||
}).map(parsePackageRequirement)
|
||||
|
||||
// resolve and install precise versions that are available in available inventories
|
||||
for await (const pkg of await resolve(pkgs)) {
|
||||
console.log({ installing: pkg.project })
|
||||
const installation = install(pkg)
|
||||
await link(installation)
|
||||
}
|
Loading…
Reference in a new issue