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.

Collect the local files

Collect the local files

From the course: Learning Static Site Building with Jekyll

Start my 1-month free trial

Collect the local files

- [Instructor] After connecting to the server, the first thing the deploy script needs to do is collect a list of all the generated site files and directories that need to be uploaded to the server. We'll do that in the scan local files function. Instead of returning an empty array, now we can start fleshing this out. Let's say we'll say the local public directory equals upath.join joining the path process.cwd, which is current working directory. Basically where we are right now, plus the public folder, which is where we know the site files will be generated to. Then we need to return a glob and we'll use the back ticks instead of quotes here to do string interpolation and node which means we can do this. Local public dir forward slash star star forward slash star, which is a syntax that means get me everything, every file and folder recursively underneath the public folder. Then after that comes back, we'll get a bunch of matches. We'll call those glob matches. And open up some code,…

Contents