TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

SOLVED: How to download folders on github for projects?

Forums > SwiftUI

Im getting started on project 8 and there is a big image folder with pictures of astronauts and logos on github and I dont know how to downoad it as a zip to import in the project.

thanks

2      

Assuming you're referring to the contents of the Images folder in this repo, then here's a way. It's not pretty or reusable, but it'll work:

1) Open up terminal and cd into the folder you want to save the images in 2) Paste in the code at the bottom of the answer and hit enter.

Essentially what this does is it first creates an images forlder in the folder you are currently in, and navigates to it. It then loops over (hopefully) all the images in the folder on Github and uses CURL to download them.

mkdir images && cd images && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/aldrin%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/aldrin%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/anders%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/anders%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo10%402x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo10%403x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo11%402x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo11%403x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo12%402x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo12%403x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo13%402x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo13%403x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo14%402x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo14%403x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo15%402x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo15%403x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo16%402x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo16%403x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo17%402x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo17%403x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo1%402x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo1%403x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo7%402x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo7%403x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo8%402x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo8%403x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo9%402x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/apollo9%403x.png && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/armstrong%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/armstrong%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/bean%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/bean%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/borman%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/borman%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/cernan%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/cernan%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/chaffee%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/chaffee%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/collins%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/collins%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/conrad%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/conrad%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/cunningham%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/cunningham%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/duke%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/duke%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/eisele%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/eisele%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/evans%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/evans%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/gordon%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/gordon%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/grissom%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/grissom%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/haise%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/haise%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/irwin%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/irwin%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/lovell%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/lovell%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/mattingly%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/mattingly%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/mcdivitt%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/mcdivitt%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/mitchell%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/mitchell%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/roosa%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/roosa%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/schirra%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/schirra%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/schmitt%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/schmitt%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/schweickart%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/schweickart%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/scott%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/scott%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/shepard%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/shepard%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/stafford%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/stafford%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/swigert%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/swigert%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/white%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/white%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/worden%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/worden%403x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/young%402x.jpg && curl -O https://raw.githubusercontent.com/twostraws/HackingWithSwift/master/SwiftUI/project8-files/Images/young%403x.jpg

EDIT: If you want it as a zip you can then just zip up the images folder created by the above script :)

Let me know if it helped :)

EDIT 2: Just realized the project 8 folder is part of a big Hacking with Swift repo that contains the assets for all the Hacking with Swift projects, that's why it can't be downloaded individually. A better approach than what I said above might be to just download a zip of the whole repo from here (use the green "Clone or download" button, then click "Download ZIP"). This will download the files for all the projects.

2      

Hacking with Swift is sponsored by Blaze.

SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free!

Reserve your spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.