#!/bin/sh set -e if ! [ -e ".netlify/state.json" ]; then echo "“.netlify/state.json” is missing, create it in your repository with “netlify deploy”" exit 1 fi if [ -z "$PLUGIN_DIR" ]; then echo "Please specify “dir”" exit 1 fi if [ -z "$PLUGIN_AUTH_TOKEN" ]; then echo "Please specify “auth_token”" exit 1 fi netlify deploy -a "$PLUGIN_AUTH_TOKEN" -d "$PLUGIN_DIR" -m "$(git log -1 --pretty=%B)" $( if [ -n "$PLUGIN_PROD" ]; then echo "-p" else echo "--alias $(git log -1 --pretty=%H)" fi )