#!/usr/bin/env bash set -euf # set -x # debugging if [ "" != $BASH ] then set -o pipefail fi #--------------------------------------------------- # Sanity checks #--------------------------------------------------- # We should have `patch` tool available hash patch 2>/dev/null || { echo >&2 "The patch tool is required, but not found."; exit 1; } # We should have an unambigious custom.bootstrap.import.less to work with export BOOTSTRAP_COUNT=`find . -name custom.bootstrap.import.less | wc -l` if [ "$BOOTSTRAP_COUNT" -ne "1" ]; then echo "Run this in the directory of your custom.bootstrap.import.less file" exit 1 fi # Attempt to patch export BOOTSTRAP=`find . -name custom.bootstrap.import.less` echo "Attempting to patch custom.bootstrap.import.less" patch "$BOOTSTRAP" <