alok8bb / cloneit

A cli tool to download specific GitHub directories or files
MIT License
74 stars 2 forks source link

Zipping fails with a single file #15

Open uncenter opened 1 month ago

uncenter commented 1 month ago

Running cloneit https://github.com/alok8bb/cloneit/blob/master/install.sh --zip (or cargo run -- https://github.com/alok8bb/cloneit/blob/master/install.sh --zip) fails with a zipping error.

alok8bb commented 1 month ago

Hmm... will have to check this.

uncenter commented 1 month ago

Ah, I see. Hard coded in the code actually! https://github.com/alok8bb/cloneit/blob/6198556e810d964cc5938c446ef42fc21b55fe0b/src/file_archiver.rs#L82-L84

uncenter commented 1 month ago

After doing some refactoring (#17) I've come to better understand the codebase. The issue here is that we don't know the files that are being downloaded, and individual files are not downloaded to the source directory (aka we don't even know the file path to potentially add to the zip). I think tracking what files are being downloaded and where, and returning this from the requesting/downloading functions, can unlock a bunch of new functionality; we can log that output to the user (see https://github.com/alok8bb/cloneit/pull/14#discussion_r1694011651), zip the files without using a whole WalkDir instance (perf presumably), etc.

I'll look into how we can do that after finishing up the potential refactors!