From the course: Learning Static Site Building with Jekyll

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Upload the site content

Upload the site content

From the course: Learning Static Site Building with Jekyll

Start my 1-month free trial

Upload the site content

- [Narrator] The last thing the deployment script needs to do is actually deploy the files. We'll write two methods to do this, one that creates any folders we need on the server, and then one that uploads the files themselves. I'll start with the create directories for function. We get a list of local items, so what I want to do is let directories to create coming from items.filter, pull out any item from that list of items that's a directory. We'll say, given the path, we'll select or filter everything where the path is a directory. Now, all we need to do is return promise.all, because we're going to do multiple operations here, we'll say directories to create.map For each directory we need to do sftp.mkdir, make directory, we'll say dir.remote path because we know what the remote path is supposed to be already and we will want to do it recursively, if necessary. Then, after that's done, we'll say .then, and this should be familiar by now, we'll do console.log, created directory…

Contents