solidarity-bash

Inspired by solidarity npm package

A lightweight Bash script version of solidarity

  • Grouping (without spaces)
  • Custom messages ({{installedVersion}} and {{wantedVersion}} variables supported)
  • Versioning support (SemVer)
  • Custom RegExp support

Example

.solidarity

{
  "$schema": "http://json.schemastore.org/solidaritySchema",
  "requirements": {
    "Android": [
      {
        "rule": "cli",
        "binary": "emulator"
      },
      {
        "rule": "env",
        "variable": "ANDROID_HOME",
        "error": "The ANDROID_HOME environment variable must be set to your local SDK.  Refer to getting started docs for help."
      }
    ],
    "iOS": [
      {
        "rule": "cli",
        "binary": "xcodebuild",
        "version": "-version",
        "semver": ">=13.0.0",
        "error": "You have xcodebuild@{{installedVersion}}. Fix with install xcode v{{wantedVersion}}",
        "platform": "darwin"
      },
      {
        "rule": "cli",
        "binary": "gem",
        "version": "list ffi",
        "semver": ">=1.15.5 <2.0.0",
        "error": "You have ffi@{{installedVersion}}. Fix with `gem install ffi --version {{wantedVersion}} --user-install`. More info https://github.com/ffi/ffi",
        "platform": "darwin"
      },
    ],
    "Git": [
      {
        "rule": "shell",
        "command": "git config user.email",
        "match": ".+@.+"
      }
    ]
  }
}