pulsecas.blogg.se

Mac compress folder excluding files
Mac compress folder excluding files










You can also skip to the end to see the finished Makefile. ), and only zipping up directories that have been modified since the last time Make was run. What follows here is a step-by-step didactic explanation of how I built a set of Makefile recipes to automatically zip up all the directories within a given directory, excluding invisible files (i.e. any file or directory that begins with a. And it turns out that it’s possible, though the end result looks really cryptic (as do all Makefiles, really). I figured that since I’m already using a Makefile to generate and upload the course website, I’d try to use the magical power of Make to automatically zip up project folders as I build the site and update them only if there are any changes. But once again, I regularly forget to do this and end up including unwanted files. To avoid shipping these out to students, I typically go to the terminal, manually delete the unwanted invisible files, and then zip up the directory. DS_Store files when it zips up folders, and R and RStudio create their own invisible files and folders, like. SO MANY TIMES I’ve fixed errors in R scripts or data but then have forgotten to rezip the project, and students end up downloading the uncorrected version of projects. zip files on macOS is trivial-right click on a folder, choose “Compress ”, and you’re done.īut it’s tedious when you have lots of folders to zip, and even more tedious to remember to rezip folders where you’ve made changes. To make it easier to distribute problem sets and projects to students, I zip these subfolders into single files like problem_set_1.zip, so they just have to download one thing. I teach students R, and R projects rarely consist of a single file. One that I’ve suffered through for the past few years is the creation and distribution of zipped files.

mac compress folder excluding files

There are occasional points of friction, though.

mac compress folder excluding files

I use a Makefile to run the requisite commands with make deploy, which creates a magical incantation: R, blogdown, and Hugo parse R Markdown files and generate a complete HTML site, which then gets synced to my server, all with minimal input from me.

mac compress folder excluding files mac compress folder excluding files

I use blogdown to generate the websites for all the courses I teach, and it’s delightful to not have to worry about databases and server configurations. You can (and should) download the project from there if you want to follow along and try this out.












Mac compress folder excluding files