sh file which looked (simplistically) like this: # Fire my node script for adding an icon to my gallery Previously, I was using imagemagick and imageoptim on my local computer to resize and optimize each icon before committing it to git. An optimized, resized 128×128px version.An optimized, resized 256×256px version.An optimized, resized 512×512px version.An optimized, resized 1024×1024px version.An untouched, 1024×1024px original from iTunes.This means that, for every icon I add to my gallery, I (as a general rule) store five different versions of that icon: Instead, I keep a number of resized and optimized variants on hand for contextual usage throughout the site. You see, iTunes will give me a large 1024×1024px icon, but I don’t want to serve that icon everywhere on my site. By the time my node script handed the reigns back to bash, I had everything I needed except for the optimized/resized icon variants. sh file that, when run, triggered a node script which gathered all of the details about an icon, fetched its artwork from iTunes, wrote it to disc, then handed control back to bash. My previous bash script was essentially a. Why? Because bash syntax baffles me and anytime I need to tweak a thing or two, it takes me hours to figure out the right syntax.Īt the moment, I’ve migrated all of the steps listed above to a single node script except for that last step-that’s what this post is about. My bash script used to power all four of those steps, but I’ve been slowly migrating to a script that will do all of that in JavaScript (node). Creates smaller variations of the source icon file and compresses them (for use on the web).Fetches the icon’s artwork from iTunes and writes it to disk.Asks for additional meta information (for the “post”).Asks me for the iTunes store URL of the app whose icon I want to add to my gallery.It’s basically a CLI script that does the following: For some time, I’ve been powering the automation around adding a new icon to my icon gallery sites using a bash script.
0 Comments
Leave a Reply. |