#!/bin/sh

SCRIPT_DIR=$(dirname "$0")
TOOL_PATH="$HOME/Library/Application Support/Kaleidoscope/Kaleidoscope Compare.shortcut"
TOOL_SRCPATH="$SCRIPT_DIR/Kaleidoscope Compare.shortcut"

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; }

# Open the file. This will show Shortcuts and offer to install it.
open "$TOOL_PATH"

exit 0
