mirror of
https://github.com/ivabus/pantry
synced 2024-11-27 02:35:08 +03:00
18 lines
552 B
TypeScript
18 lines
552 B
TypeScript
|
import { usePrefix } from "hooks"
|
||
|
|
||
|
export async function overlay_this_pantry() {
|
||
|
const pantry_prefix = usePrefix().join("tea.xyz/var/pantry")
|
||
|
const self = new URL(import.meta.url).path().parent().parent().parent().join("projects")
|
||
|
|
||
|
// noop, but also THIS FUCKS SHIT UP
|
||
|
if (self.parent().eq(pantry_prefix)) return
|
||
|
|
||
|
const to = pantry_prefix.join("projects")
|
||
|
for await (const [path, {isFile}] of self.walk()) {
|
||
|
if (isFile) {
|
||
|
const dst = to.join(path.relative({ to: self }))
|
||
|
path.cp({ into: dst.parent().mkpath() })
|
||
|
}
|
||
|
}
|
||
|
}
|