Skip to content

Add support for chained aliases#178

Open
andrewnicols wants to merge 1 commit intoFMCorz:masterfrom
andrewnicols:chained_aliases
Open

Add support for chained aliases#178
andrewnicols wants to merge 1 commit intoFMCorz:masterfrom
andrewnicols:chained_aliases

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