<commit_before>#!/usr/bin/env bash
INSTALL_DIR=$HOME/NOMC-medimap-viewer

set -e

info () {
  printf "\r  [ \033[00;34m..\033[0m ] %s\n" "$1"
}

user () {
  printf "\r  [ \033[0;33m??\033[0m ] %s\n" "$1"
}

success () {
  printf "\r\033[2K  [ \033[00;32mOK\033[0m ] %s\n" "$1"
}

fail () {
  printf "\r\033[2K  [\033[0;31mFAIL\033[0m] %s\n" "$1"
}

echo ''

# Epiphany needs this to store it's config. Otherwise, if the first time it
# ever starts up is in koisk mode, it simply won't start.
mkdir -p "${HOME}/.config"

info 'Cloning repo from git'
git clone https://github.com/jo12bar/NOMC-medimap-viewer "${INSTALL_DIR}"
cd "${INSTALL_DIR}"
success 'Repo cloned!'

info 'Installing packages from npm'
npm prune
npm install
success 'Packages installed!'

info 'Building app'
npm run build
success 'App built!'

info 'Adding autostart script for this user at ${HOME}/.config/lxsession/LXDE/autostart'
mkdir -p "${HOME}/.config/lxsession/LXDE"
echo "@${INSTALL_DIR}/raspi-scripts/startup > ${INSTALL_DIR}/startup.log" >> "${HOME}/.config/lxsession/LXDE-pi/autostart"
success 'Script added!'

echo ''

success 'All installed!'
echo ''<commit_msg>Run startup command within lxterminal<commit_after>#!/usr/bin/env bash
INSTALL_DIR=$HOME/NOMC-medimap-viewer

set -e

info () {
  printf "\r  [ \033[00;34m..\033[0m ] %s\n" "$1"
}

user () {
  printf "\r  [ \033[0;33m??\033[0m ] %s\n" "$1"
}

success () {
  printf "\r\033[2K  [ \033[00;32mOK\033[0m ] %s\n" "$1"
}

fail () {
  printf "\r\033[2K  [\033[0;31mFAIL\033[0m] %s\n" "$1"
}

echo ''

# Epiphany needs this to store it's config. Otherwise, if the first time it
# ever starts up is in koisk mode, it simply won't start.
mkdir -p "${HOME}/.config"

info 'Cloning repo from git'
git clone https://github.com/jo12bar/NOMC-medimap-viewer "${INSTALL_DIR}"
cd "${INSTALL_DIR}"
success 'Repo cloned!'

info 'Installing packages from npm'
npm prune
npm install
success 'Packages installed!'

info 'Building app'
npm run build
success 'App built!'

info 'Adding autostart script for this user at ${HOME}/.config/lxsession/LXDE/autostart'
mkdir -p "${HOME}/.config/lxsession/LXDE"
echo "@lxterminal --command=\"${INSTALL_DIR}/raspi-scripts/startup\"" >> "${HOME}/.config/lxsession/LXDE-pi/autostart"
success 'Script added!'

echo ''

success 'All installed!'
echo ''
{'fraction_non_alphanumeric': 0.1798093587521664, 'fraction_numerical': 0.04852686308492201, 'mean_word_length': 4.06359649122807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 2, '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': '210831', 'n_tokens_mistral': 993, 'n_tokens_neox': 898, 'n_words': 236}