<commit_before>#!/bin/bash

set -x

PACKAGE_NAME=$(cat package.json | grep name | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | xargs)
ELECTRON_VERSION=1.7.6
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | xargs)
ROOT_DIR=$(cd $(dirname $0)/..; pwd)
ZIP_IOS="${PACKAGE_NAME}-darwin-x64-v${PACKAGE_VERSION}.zip"
ZIP_WIN="${PACKAGE_NAME}-win32-ia32-v${PACKAGE_VERSION}.zip"

cd $ROOT_DIR
rm -r dist zips
mkdir -p dist/src/assets/fonts
mkdir -p zips
NODE_ENV=production webpack
sed -i '' -e 's/http:\/\/localhost:3000\///g' dist/index.html
mv dist/index.html dist/bundle.js dist/src/
cp src/splash.html src/splash.mp4 dist/src/
cp -r assets/images/*.ico assets/images/*.icns .babelrc package.json index.js dist/
cp -r assets/fonts/* dist/src/assets/fonts
cp -r src/main dist/src

cd dist
npm install
npm run rebuild

if [ "$PLATFORM" == "win32" ]; then
  electron-packager ./ ${PACKAGE_NAME} --platform=win32 --arch=ia32\
  --electron-version="${ELECTRON_VERSION}" --app-version="${PACKAGE_VERSION}" --icon=garchen-logo.ico --no-prune
  zip -r "./../zips/${ZIP_WIN}" "${PACKAGE_NAME}-win32-ia32" > /dev/null
  rm -r "${PACKAGE_NAME}-win32-ia32"
fi

if [ "$PLATFORM" == "darwin" ]; then
  electron-packager ./ ${PACKAGE_NAME} --platform=darwin --arch=x64\
    --electron-version="${ELECTRON_VERSION}" --app-version="${PACKAGE_VERSION}" --icon=garchen-logo.icns --no-prune
  zip -r "./../zips/${ZIP_IOS}" "${PACKAGE_NAME}-darwin-x64" > /dev/null
  rm -r "${PACKAGE_NAME}-darwin-x64"
fi<commit_msg>update build.sh ( add 32 bit and 64 bit windows version )<commit_after>#!/bin/bash

set -x

PACKAGE_NAME=$(cat package.json | grep name | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | xargs)
ELECTRON_VERSION=1.7.6
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | xargs)
ROOT_DIR=$(cd $(dirname $0)/..; pwd)
ZIP_IOS="${PACKAGE_NAME}-darwin-x64-v${PACKAGE_VERSION}.zip"
ZIP_WIN="${PACKAGE_NAME}-win32-ia32-v${PACKAGE_VERSION}.zip"

cd $ROOT_DIR
rm -r dist zips
mkdir -p dist/src/assets/fonts
mkdir -p zips
NODE_ENV=production webpack
sed -i '' -e 's/http:\/\/localhost:3000\///g' dist/index.html
mv dist/index.html dist/bundle.js dist/src/
cp src/splash.html src/splash.mp4 dist/src/
cp -r assets/images/*.ico assets/images/*.icns .babelrc package.json index.js dist/
cp -r assets/fonts/* dist/src/assets/fonts
cp -r src/main dist/src

cd dist
npm i --prod

if [ "$PLATFORM" == "win32-ia32" ]; then
  npm run rebuild-ia32
  electron-packager ./ ${PACKAGE_NAME} --platform=win32 --arch=ia32\
  --electron-version="${ELECTRON_VERSION}" --app-version="${PACKAGE_VERSION}" --icon=garchen-logo.ico --no-prune
  zip -r "./../zips/${ZIP_WIN}" "${PACKAGE_NAME}-win32-ia32" > /dev/null
  rm -r "${PACKAGE_NAME}-win32-ia32"
fi

if [ "$PLATFORM" == "win32-x64" ]; then
  npm run rebuild
  electron-packager ./ ${PACKAGE_NAME} --platform=win32 --arch=ia32\
  --electron-version="${ELECTRON_VERSION}" --app-version="${PACKAGE_VERSION}" --icon=garchen-logo.ico --no-prune
  zip -r "./../zips/${ZIP_WIN}" "${PACKAGE_NAME}-win32-ia32" > /dev/null
  rm -r "${PACKAGE_NAME}-win32-ia32"
fi

if [ "$PLATFORM" == "darwin" ]; then
  npm run rebuild
  electron-packager ./ ${PACKAGE_NAME} --platform=darwin --arch=x64\
    --electron-version="${ELECTRON_VERSION}" --app-version="${PACKAGE_VERSION}" --icon=garchen-logo.icns --no-prune
  zip -r "./../zips/${ZIP_IOS}" "${PACKAGE_NAME}-darwin-x64" > /dev/null
  rm -r "${PACKAGE_NAME}-darwin-x64"
fi
{'fraction_non_alphanumeric': 0.20700367127929964, 'fraction_numerical': 0.028805422197119457, 'mean_word_length': 3.7163781624500665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '1008159', 'n_tokens_mistral': 1468, 'n_tokens_neox': 1385, 'n_words': 293}