Automate Lesson Creation From Templates With ZSH Functions

John Lindquist
InstructorJohn Lindquist
Share this video with your friends

Social Share Links

Send Tweet
Published 4 years ago
Updated 3 years ago

ZSH allows you to write functions to wrap around common commands. These allow you to easiest invoke a number of lesson creation steps by only typing out the command.

John Lindquist: [0:00] I've created a +Vanilla ZSH function, which goes into my projects directory, pulls down my template with the name that's passed in, then goes into that directory, Git initializes it, adds it, adds a commit message, uses Hub to create my repo on GitHub, pushes what I created, runs my installs, then opens code and starts my project.

[0:22] In practice, that looks like this. +vanilla, and I'll just call my lesson array-reduce or something. Hit Enter, and you can watch clone and create it on GitHub. Then it'll start installing everything. Then automatically launch it in code.

[0:42] I got a popup that I don't have a gitignore set up. We should definitely add that to our template later. I'll hit Yes to add it automatically now. Then on another window, it also automatically launched my project in a browser. I can immediately just start typing here and see my changes. I have a named project locally, which is already backed up by a project on GitHub.

egghead
egghead
~ an hour ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today