<commit_before>#!/bin/bash

set -e
set -o pipefail

source ensure-uuid-set.sh

if ./ensure-installed.sh /Applications/Emacs.app/Contents/MacOS/Emacs --version "GNU Emacs" 24.5.1 assert; then
    echo "[install-emacs] It looks like an appropriate version of Emacs is already installed, but it is not symlinked correctly."
else
    echo "[install-emacs] It looks like an appropriate version of Emacs is not installed."
    if [[ -d "/Applications/Emacs.app" ]]; then
        echo "[install-emacs] Moving the existing version to originals/$uuid."
        mv /Applications/Emacs.app originals/$uuid/Emacs.app
    fi
    echo "[install-emacs] Downloading Emacs from emacsformacosx.com."
    # Specifying the filename makes wget override any existing file by that name
    wget -O Emacs-24.5-1-universal.dmg "https://emacsformacosx.com/emacs-builds/Emacs-24.5-1-universal.dmg"
    echo "[install-emacs] Mounting the Emacs disk image."
    hdiutil mount Emacs-24.5-1-universal.dmg
    echo "[install-emacs] Copying Emacs.app from the disk image to the Applications folder."
    cp -R /Volumes/Emacs/Emacs.app /Applications/Emacs.app
    echo "[install-emacs] Unmounting the Emacs disk image."
    hdiutil unmount /Volumes/Emacs
    echo "[install-emacs] Deleting the Emacs disk image."
    rm Emacs-24.5-1-universal.dmg
fi<commit_msg>Account for a pre-existing file called Emacs.app<commit_after>#!/bin/bash

set -e
set -o pipefail

source ensure-uuid-set.sh

if ./ensure-installed.sh /Applications/Emacs.app/Contents/MacOS/Emacs --version "GNU Emacs" 24.5.1 assert; then
    echo "[install-emacs] It looks like an appropriate version of Emacs is already installed, but it is not symlinked correctly."
else
    echo "[install-emacs] It looks like an appropriate version of Emacs is not installed."
    if [[ -e "/Applications/Emacs.app" || -L "/Applications/Emacs.app" ]]; then
        echo "[install-emacs] Moving the existing version to originals/$uuid."
        mv /Applications/Emacs.app originals/$uuid/Emacs.app
    fi
    echo "[install-emacs] Downloading Emacs from emacsformacosx.com."
    # Specifying the filename makes wget override any existing file by that name
    wget -O Emacs-24.5-1-universal.dmg "https://emacsformacosx.com/emacs-builds/Emacs-24.5-1-universal.dmg"
    echo "[install-emacs] Mounting the Emacs disk image."
    hdiutil mount Emacs-24.5-1-universal.dmg
    echo "[install-emacs] Copying Emacs.app from the disk image to the Applications folder."
    cp -R /Volumes/Emacs/Emacs.app /Applications/Emacs.app
    echo "[install-emacs] Unmounting the Emacs disk image."
    hdiutil unmount /Volumes/Emacs
    echo "[install-emacs] Deleting the Emacs disk image."
    rm Emacs-24.5-1-universal.dmg
fi
{'fraction_non_alphanumeric': 0.10731348768834988, 'fraction_numerical': 0.01470047776552738, 'mean_word_length': 3.390322580645161, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5291208', 'n_tokens_mistral': 918, 'n_tokens_neox': 878, 'n_words': 275}