anishathalye / dotbot

A tool that bootstraps your dotfiles ⚡️
MIT License
6.9k stars 287 forks source link

feat(shell): run shell command conditionally #321

Open Clumsy-Coder opened 1 year ago

Clumsy-Coder commented 1 year ago

what

how

why

where

usage

Create dotbot config

- shell:
    - command: echo "this is running on a MacOS"
      if: uname -s | grep -i "Darwin"
- shell:
    - command: echo "This command should be skipped"
      if: false
- shell:
    - command: apt update && apt upgrade -y
      if: lsb_release -i | grep -io 'debian'
      description: Update APT package repository

    - command: dnf update -y
      if: lsb_release -i | grep -io 'fedora'
      description: Update DNF package repository

NOTE

Clumsy-Coder commented 1 year ago

Pull Request connected to issue #312

Clumsy-Coder commented 1 year ago

I tested it as much as I can.

This is first time working in Python code.

So, if issue surfaces, let me know

wonderbeyond commented 1 year ago

Hi, I just made the dotbot-if plugin, and found it's sharing the similar idea with this PR.