Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for chained aliases #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewnicols
Copy link
Contributor

This allows you to specify an array for an alias and have it execute
each of the commands in turn.

For example you may specify the following configuration:

"co": [
    "fix",
    "pull -m fetch",
    "!git reset --hard FETCH_HEAD"
],

This will lead to the command mdk co 12345 running:

mdk fix 12345
mdk pull -m fetch 12345
git reset --hard FETCH_HEAD

This allows you to specify an array for an alias and have it execute
each of the commands in turn.

For example you may specify the following configuration:

    "co": [
        "fix",
        "pull -m fetch",
        "!git reset --hard FETCH_HEAD"
    ],

This will lead to the command `mdk co 12345` running:

    mdk fix 12345
    mdk pull -m fetch 12345
    git reset --hard FETCH_HEAD
@FMCorz
Copy link
Owner

FMCorz commented May 20, 2019

Thanks Andrew, good idea!

Would you mind having a look through the alias command to handle this new format of aliases? Listing and show an alias could probably do with some tweaks to display lists.

We may always want to ensure that the add or set sub commands cannot be used with lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants