gh-download icon indicating copy to clipboard operation
gh-download copied to clipboard

How to download just a folder but not creating a parent directory?

Open Kritiqual opened this issue 1 year ago • 2 comments

For example, I want to download Sweet-cursors folder I used this command:

gh download EliverLara/Sweet -b nova kde/cursors/Sweet-cursors

But instead only Sweet-cursors folder, the result is as below:

kde
 \__cursors		
		\__Sweet-cursors

Can you help me on this?

Kritiqual avatar Nov 21 '24 13:11 Kritiqual

The default will reserved repo dir path, but you can use the the --outdir option to specify a directory

For example:

gh download https://github.com/EliverLara/Sweet/tree/nova/kde/cursors/Sweet-cursors --outdir Sweet-cursors

It will only remove kde/cursors prefix

gh download https://github.com/EliverLara/Sweet/tree/nova/kde/cursors/Sweet-cursors --outdir otherdir

With rename Sweet-cursors to otherdir

You can use --dry-run to output the information to help you confirm before you download

yuler avatar Nov 22 '24 02:11 yuler

Thanks, this works!

Kritiqual avatar Nov 27 '24 13:11 Kritiqual