#!/bin/sh

set -e

if [ $(uname -s) == 'Darwin' ]; then
  if [ "$(whoami)" == "root" ]; then
    TARGET_DIR="/Library/Google/Chrome/NativeMessagingHosts"
  else
    TARGET_DIR=\
        "$HOME/Library/Application Support/Google/Chrome/NativeMessagingHosts"
  fi
else
  if [ "$(whoami)" == "root" ]; then
    TARGET_DIR="/etc/opt/chrome/native-messaging-hosts"
  else
    TARGET_DIR='$HOME/.config/google-chrome/NativeMessagingHosts'
  fi
fi

HOST_NAME=com.jeffreywear.photocopier
rm "$TARGET_DIR/$HOST_NAME.json"
echo Native messaging host $HOST_NAME has been uninstalled.
#!/bin/sh

set -e

if [ $(uname -s) == 'Darwin' ]; then
  if [ "$(whoami)" == "root" ]; then
    TARGET_DIR="/Library/Google/Chrome/NativeMessagingHosts"
  else
    TARGET_DIR="$HOME/Library/Application Support/Google/Chrome/NativeMessagingHosts"
  fi
else
  if [ "$(whoami)" == "root" ]; then
    TARGET_DIR="/etc/opt/chrome/native-messaging-hosts"
  else
    TARGET_DIR='$HOME/.config/google-chrome/NativeMessagingHosts'
  fi
fi

HOST_NAME=com.jeffreywear.photocopier
rm "$TARGET_DIR/$HOST_NAME.json"
echo Native messaging host $HOST_NAME has been uninstalled.
Remove attempt at line escaping.
Remove attempt at line escaping.

Does not work in sh.
