MitocGroup/run-jst

View on GitHub
publish-all-components.sh

Summary

Maintainability
Test Coverage
#!/usr/bin/env bash

### License MIT
### 2017 AdTechMedia.io (c)
### Author: AlexanderC <acucer@mitocgroup.com>

function fail () {
  echo >&2 "[FAILED] $1!"
  exit 1
}

function validate_input () {
  if [ -z "$1" ]
  then
    fail "Please provide a valid semver function (https://github.com/npm/node-semver#functions)"
  fi
}

validate_input "$@"

for COMPONENT in $(find ./components -type d -depth 1 -exec basename {} \;)
do
    ./publish-component.sh "$1" "$COMPONENT"
done