repos:
- repo: local
  hooks:
    - id: gen-versions-map
      name: Generate versions map and check for changes
      entry: sh -c 'make -C packages/apps check-version-map && make -C packages/extra check-version-map'
      language: system
      types: [file]
      pass_filenames: false
      description: Run the script and fail if it generates changes
    - id: run-make-generate
      name: Run 'make generate' in all app directories
      entry: |
        /bin/bash -c '
          for dir in ./packages/apps/*/; do
            if [ -d "$dir" ]; then
              echo "Running make generate in $dir"
              (cd "$dir" && make generate)
            fi
          done
          git diff --color=always | cat
        '
      language: script
      files: ^.*$
