osl-incubator / makim

Make Improved
https://osl-incubator.github.io/makim/
BSD 3-Clause "New" or "Revised" License
8 stars 10 forks source link

Add to the target an option for success and failure #18

Open xmnlab opened 1 year ago

xmnlab commented 1 year ago

It would be nice if the target has an option for success or failure .. so we can have alternatives commands for both flows.

xmnlab commented 1 year ago

example:

version: 1.0.0
groups:
  - name: default
    env-file: .env
    targets:
      clean:
        help: Use this target to clean up temporary files
        args:
          all:
            type: bool
            action: store_true
            help: Remove all files that are tracked by git
        run: |
          echo "remove file X"
        success: echo "ok"
        failure: echo "false"
      build:
        help: Build the program
        args:
          clean:
            type: bool
            action: store_true
            help: if not set, the clean dependency will not be triggered.
        dependencies:
          - target: clean
            if: \${\{ args.clean == true \}\}
        run: |
          echo "build file x"
          echo "build file y"