0

I want an alias shortcut to achieve the following:

  1. Clone a github repository with a custom folder name
  2. Open it in my fav text editor (atom)

I currently use this inside ~/.zshrc:

alias quickstart="git clone https://github.com/myname/quickstart-html-template.git new_html_project && atom new_html_project"

Can I parameterize new_html_project?

1
  • Why was bash tagged on this Q?
    – Jeff Schaller
    Commented Feb 17, 2017 at 3:22

1 Answer 1

2

You can't define parameters in an alias, you need to use a function:

quickstart() {
    git clone https://github.com/myname/quickstart-html-template.git "$1" && atom "$1"
}

Add that to your .zshrc instead of the alias definition.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .