mirror of
https://github.com/ivabus/pantry
synced 2024-11-30 04:05:06 +03:00
17 lines
552 B
TypeScript
17 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() })
|
|
}
|
|
}
|
|
}
|