<commit_before>#!/bin/bash
#
# This script creates a optimized build for packaging purposes
#

ROOTDIR=".build/output"
OUTDIR=".build/output"
TMPDIR=".build/tmp"
PREFIX=""
TEMPLATE=$1

if [ "$TEMPLATE" == "arduino" ]; then
  if [ "$(git rev-parse --abbrev-ref HEAD)" != "arduino" ]; then
    echo "You need to be on the 'arduino' brach to do this"
    exit 1
  fi
  OUTDIR=".build/output/osjs"
fi

#
# Reset
#
rm -rf $ROOTDIR
mkdir -p $OUTDIR
mkdir -p $TMPDIR
rm -rf dist/themes/*
rm -rf dist/packages/*

rm src/conf/500-arduino.json 2>/dev/null
rm src/conf/500-edison.json 2>/dev/null
rm src/conf/500-x11.json 2>/dev/null

if [ "$TEMPLATE" == "arduino" ]; then
  (cd src/conf; ln -sf ../templates/conf/500-arduino.json 500-arduino.json)
fi

if [ "$TEMPLATE" == "intel-edison" ]; then
  (cd src/conf; ln -sf ../templates/conf/500-edison.json 500-edison.json)
fi

if [ "$TEMPLATE" == "deb" ]; then
  (cd src/conf; ln -sf ../templates/conf/500-x11.json 500-x11.json)
fi

echo "[image] Updating sources..."

git checkout -- dist &>/dev/null
npm install --production &>/dev/null

echo "[image] Building..."

#
# Build and copy required files
#

grunt all dist-files &>/dev/null
<commit_msg>build: make-packaged updated edison support<commit_after>#!/bin/bash
#
# This script creates a optimized build for packaging purposes
#

ROOTDIR=".build/output"
OUTDIR=".build/output"
TMPDIR=".build/tmp"
PREFIX=""
TEMPLATE=$1

if [ "$TEMPLATE" == "arduino" ]; then
  if [ "$(git rev-parse --abbrev-ref HEAD)" != "arduino" ]; then
    echo "You need to be on the 'arduino' brach to do this"
    exit 1
  fi
  OUTDIR=".build/output/osjs"
fi

#
# Reset
#
rm -rf $ROOTDIR
mkdir -p $OUTDIR
mkdir -p $TMPDIR
rm -rf dist/themes/*
rm -rf dist/packages/*

rm src/conf/500-arduino.json 2>/dev/null
rm src/conf/500-edison.json 2>/dev/null
rm src/conf/500-x11.json 2>/dev/null

if [ "$TEMPLATE" == "arduino" ]; then
  (cd src/conf; ln -sf ../templates/conf/500-arduino.json 500-arduino.json)
fi

if [ "$TEMPLATE" == "intel-edison" ]; then
  (cd src/conf; ln -sf ../templates/conf/500-edison.json 500-edison.json)
fi

if [ "$TEMPLATE" == "deb" ]; then
  (cd src/conf; ln -sf ../templates/conf/500-x11.json 500-x11.json)
fi

echo "[image] Updating sources..."

rm -rf node_modules

git checkout -- dist &>/dev/null
npm install --production &>/dev/null

if [ "$TEMPLATE" == "intel-edison" ]; then
  npm install mraa
  npm install userid passwd-linux
fi

echo "[image] Building..."

#
# Build and copy required files
#

grunt all dist-files &>/dev/null

{'fraction_non_alphanumeric': 0.17320650019817677, 'fraction_numerical': 0.030122869599682918, 'mean_word_length': 3.3293310463121784, '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': '7445531', 'n_tokens_mistral': 1063, 'n_tokens_neox': 964, 'n_words': 269}