<commit_before>#!/bin/bash
set -e

case "$1" in
  install)
    echo "Installing skype..."
    install -m 0755 /scripts/skype /target/
    ;;
  uninstall)
    echo "Uninstalling skype..."
    rm -rf /target/skype
    ;;
  bash)
    exec $@
    ;;
  *)
    # uid and gid of host user
    USER_UID=${USER_UID:-1000}
    USER_GID=${USER_GID:-1000}

    # create user group
    if ! getent group ${SKYPE_USER} >/dev/null; then
      groupadd -f -g ${USER_GID} ${SKYPE_USER} >/dev/null 2>&1
    fi

    # create user with uid and gid matching that of the host user
    if ! getent passwd ${SKYPE_USER} >/dev/null; then
      adduser --disabled-login --uid ${USER_UID} --gid ${USER_GID} \
        --gecos 'Skype' ${SKYPE_USER} >/dev/null 2>&1
    fi

    # grant access to video devices
    for device in /dev/video*
    do
      if [[ -c $device ]]; then
        VIDEO_GID=$(stat -c %g $device)
        break
      fi
    done

    if [[ -n $VIDEO_GID ]]; then
      usermod -a -G $VIDEO_GID ${SKYPE_USER}
    fi

    # take ownership
    chown ${SKYPE_USER}:${SKYPE_USER} -R /home/${SKYPE_USER}

    # launch application as ${SKYPE_USER}
    cd /home/${SKYPE_USER}
    exec sudo -u ${SKYPE_USER} -H PULSE_SERVER=/run/pulse/native QT_GRAPHICSSYSTEM="native" $@
    ;;
esac<commit_msg>entrypoint.sh: do setup only when launching `skype`<commit_after>#!/bin/bash
set -e

case "$1" in
  install)
    echo "Installing skype..."
    install -m 0755 /scripts/skype /target/
    ;;
  uninstall)
    echo "Uninstalling skype..."
    rm -rf /target/skype
    ;;
  skype)
    # uid and gid of host user
    USER_UID=${USER_UID:-1000}
    USER_GID=${USER_GID:-1000}

    # create user group
    if ! getent group ${SKYPE_USER} >/dev/null; then
      groupadd -f -g ${USER_GID} ${SKYPE_USER} >/dev/null 2>&1
    fi

    # create user with uid and gid matching that of the host user
    if ! getent passwd ${SKYPE_USER} >/dev/null; then
      adduser --disabled-login --uid ${USER_UID} --gid ${USER_GID} \
        --gecos 'Skype' ${SKYPE_USER} >/dev/null 2>&1
    fi

    # grant access to video devices
    for device in /dev/video*
    do
      if [[ -c $device ]]; then
        VIDEO_GID=$(stat -c %g $device)
        break
      fi
    done

    if [[ -n $VIDEO_GID ]]; then
      usermod -a -G $VIDEO_GID ${SKYPE_USER}
    fi

    # take ownership
    chown ${SKYPE_USER}:${SKYPE_USER} -R /home/${SKYPE_USER}

    # launch application as ${SKYPE_USER}
    cd /home/${SKYPE_USER}
    exec sudo -u ${SKYPE_USER} -H PULSE_SERVER=/run/pulse/native QT_GRAPHICSSYSTEM="native" $@
    ;;
  *)
    exec $@
    ;;
esac
{'fraction_non_alphanumeric': 0.1418111753371869, 'fraction_numerical': 0.013102119460500963, 'mean_word_length': 2.2944162436548226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6291182', 'n_tokens_mistral': 1019, 'n_tokens_neox': 958, 'n_words': 265}