1
0
Fork 0
mirror of synced 2024-06-15 05:41:10 -04:00
dotbot/dotbot
Clumsy-Coder 25ef5d5a5f feat(shell): run shell command conditionally
## what
  - add feature to run shell command (optionally)

  ## how
  - the shell directive will check if the 'if' property is available.
    If it is, it will run the command in 'if' property.
    If the command results in a return 0 code or 'true', then the
    'command' property will run.
    If the condition to run the command is a non 0 code or 'false',
      the shell command won't run
  - dotbot config example:
    ```yaml
    - shell:
        - command: echo "this is running on a MacOS"
          if: uname -s | grep -i "Darwin"
    ```
  - dotbot config example: skipping command if false
    ```yaml
    - shell:
        - command: echo "This command should be skipped"
          if: false
    ```

  ## why
  - can run the shell command conditionally
  - can use multiple dotbot configs to run different OS
    - Ex: incorporating it in https://github.com/ecarlson94/dotbot-template

  ## where
  - file changed in `./dotbot/plugins/shell.py`

  ## usage
  Create dotbot config
    ```yaml
    - shell:
        - command: echo "this is running on a MacOS"
          if: uname -s | grep -i "Darwin"
    ```

    ```yaml
    - shell:
        - command: echo "This command should be skipped"
          if: false
    ```
2022-08-11 21:10:50 -06:00
..
messenger Migrate code style to Black 2022-01-30 18:53:05 -05:00
plugins feat(shell): run shell command conditionally 2022-08-11 21:10:50 -06:00
util Migrate code style to Black 2022-01-30 18:53:05 -05:00
__init__.py Migrate code style to Black 2022-01-30 18:53:05 -05:00
__main__.py Added support to run with python -m 2020-07-23 08:44:06 -07:00
cli.py Migrate code style to Black 2022-01-30 18:53:05 -05:00
config.py Migrate code style to Black 2022-01-30 18:53:05 -05:00
context.py Migrate code style to Black 2022-01-30 18:53:05 -05:00
dispatcher.py Migrate code style to Black 2022-01-30 18:53:05 -05:00
plugin.py Migrate code style to Black 2022-01-30 18:53:05 -05:00