#!/bin/bash

cd "$HOME/Downloads" || exit 1

echo "Step 1 of 4: Downloading WordStat..."
curl --progress-bar -fL -o WordStat.tar.xz "https://provalisresearch.com/Download/WordStat.tar.xz" || exit 1

echo
echo "Step 2 of 4: Installing WordStat in Applications. Please wait..."
tar -xJf WordStat.tar.xz -C /Applications/ || exit 1

echo
echo "Step 3 of 4: Preparing WordStat for macOS..."
xattr -drs com.apple.quarantine "/Applications/WordStat.app" 2>/dev/null || trueThe

echo
echo "Step 4 of 4: Cleaning up..."
rm -f WordStat.tar.xz

echo
echo "Done. WordStat has been installed in the Applications folder."
echo "You can now open WordStat from Applications."
echo
read -n 1 -s -r -p "Press any key to close this window..."