tridactyl/scripts/build.sh

59 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/sh
2017-11-20 18:13:26 +00:00
set -e
2018-03-04 14:15:26 +01:00
CLEANSLATE="node_modules/cleanslate/docs/files/cleanslate.css"
2018-05-16 01:52:03 +10:00
isWindowsMinGW() {
local is_mingw="False"
if [ "$(uname | cut -c 1-5)" == "MINGW" ]; then
is_mingw="True"
fi
echo -n "${is_mingw}"
}
2018-05-16 01:52:03 +10:00
if [ "$(isWindowsMinGW)" == "True" ]; then
WIN_PYTHON="py -3"
NPM_BIN_DIR="$(cygpath $(npm bin))"
PATH=$NPM_BIN_DIR:$PATH
else
PATH="$(npm bin):$PATH"
fi
export PATH
mkdir -p build
mkdir -p build/static
mkdir -p generated/static
mkdir -p generated/static/clippy
if [ "$(isWindowsMinGW)" == "True" ]; then
$WIN_PYTHON -3 scripts/excmds_macros.py
else
python3 scripts/excmds_macros.py
fi
scripts/newtab.md.sh
scripts/make_tutorial.sh
scripts/make_docs.sh &
nearleyc src/grammars/bracketexpr.ne \
> src/grammars/.bracketexpr.generated.ts
2018-05-16 01:52:03 +10:00
if [ "$(isWindowsMinGW)" == "True" ]; then
powershell native/win_install.ps1 -DebugDirBase native
else
native/install.sh local
fi
(webpack --display errors-only \
&& scripts/git_version.sh) &
wait
if [ -e "$CLEANSLATE" ] ; then
cp -v "$CLEANSLATE" build/static/cleanslate.css
else
echo "Couldn't find cleanslate.css. Try running 'npm install'"
fi