Repository navigation
feat: project download - #194
Conversation
|
One potential surprise here is that this gets the project dir which wouldn't contain all the overlaid files ( |
| async function* generateProjectTgz(owner: { id: string }, projectId: string): AsyncGenerator<Uint8Array, void> { | ||
| const tar = spawn('tar', ['-czf', '-', '--exclude=./.lake', '.'], { |
There was a problem hiding this comment.
@Vtec234 I'm actually explicitly excluding .lake in its entirety. If we have overlay files in the future that aren't part of .lake I'd think those should be part of the download.
158e572 to
c112e01
Compare
c112e01 to
e6f54d7
Compare
|
Yeah, I think I would also cast a vote for excluding The value of including |
| // 404 rather than 403 to avoid leaking the existence of inaccessible projects. | ||
| if (!project || !canAccessProject(session.user, project)) notFound() |
There was a problem hiding this comment.
thought that needn't be for this PR but I'm noticing a repeated pattern: should we extract a helper function that makes "check if this project seems to exist according to our current auth'ed user" easier to naturally get right?
e6f54d7 to
d643bc4
Compare
Project cogwheel grows a new header — intentionally a
MenuItemwith ahrefand not a Next-ifiedMenuLinkItem, since we definitely don't want prefetching — which downloads a tarball without ever materializing it on the hard drive.Learned a couple fun things in the process: