#!/bin/sh

SCRIPT_DIR=$(dirname "$0")
SCRIPT=$"Diff Unsaved Changes in Kaleidoscope.sh"
APP_SUPPORT=$"$HOME/Library/Application Support/BBEdit/Scripts"
TOOL_ENDPATH="$APP_SUPPORT/$SCRIPT"
TOOL_PATH="$TOOL_ENDPATH"
TOOL_SRCPATH="$SCRIPT_DIR/$SCRIPT"

if [ -r "$TOOL_SRCPATH" ] ; then
 echo "Source found $TOOL_SRCPATH"
  :
else
  echo "Could not read integration script source '$TOOL_SRCPATH'" >&2
  exit 1
fi

# Copy integration script to application support
cp "$TOOL_SRCPATH" "$TOOL_PATH" || { echo "Copy to '$TOOL_PATH' failed"; exit 1; }

exit 0
