2017-11-12 01:42:55 +00:00
|
|
|
#!/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-10-10 18:41:08 +02:00
|
|
|
TRIDACTYL_LOGO="src/static/logo/Tridactyl_64px.png"
|
2017-11-12 01:42:55 +00:00
|
|
|
|
2018-05-16 01:52:03 +10:00
|
|
|
isWindowsMinGW() {
|
2019-03-24 17:29:42 +01:00
|
|
|
is_mingw="False"
|
2018-05-28 13:06:45 +10:00
|
|
|
if [ "$(uname | cut -c 1-5)" = "MINGW" ] \
|
|
|
|
|| [ "$(uname | cut -c 1-4)" = "MSYS" ]; then
|
2018-05-14 14:19:20 +10:00
|
|
|
is_mingw="True"
|
|
|
|
fi
|
|
|
|
|
2019-03-24 17:29:42 +01:00
|
|
|
printf "%s" "${is_mingw}"
|
2018-05-14 14:19:20 +10:00
|
|
|
}
|
|
|
|
|
2018-05-17 07:04:03 -07:00
|
|
|
if [ "$(isWindowsMinGW)" = "True" ]; then
|
2018-05-16 02:22:24 +10:00
|
|
|
WIN_PYTHON="py -3"
|
2019-05-31 16:48:53 +01:00
|
|
|
YARN_BIN_DIR="$(cygpath "$(yarn bin)")"
|
2019-05-31 18:44:40 +01:00
|
|
|
PATH=$YARN_BIN_DIR:$PATH
|
2018-05-14 14:19:20 +10:00
|
|
|
else
|
2019-05-31 16:48:53 +01:00
|
|
|
PATH="$(yarn bin):$PATH"
|
2018-05-14 14:19:20 +10:00
|
|
|
fi
|
|
|
|
|
|
|
|
export PATH
|
|
|
|
|
|
|
|
mkdir -p build
|
|
|
|
mkdir -p build/static
|
2017-11-12 01:42:55 +00:00
|
|
|
mkdir -p generated/static
|
2018-04-13 23:30:53 +01:00
|
|
|
mkdir -p generated/static/clippy
|
2018-05-14 14:19:20 +10:00
|
|
|
|
2018-05-17 07:04:03 -07:00
|
|
|
if [ "$(isWindowsMinGW)" = "True" ]; then
|
2018-05-16 04:39:32 +10:00
|
|
|
$WIN_PYTHON scripts/excmds_macros.py
|
2018-05-16 02:22:24 +10:00
|
|
|
else
|
2018-05-16 04:39:32 +10:00
|
|
|
scripts/excmds_macros.py
|
2018-05-16 02:22:24 +10:00
|
|
|
fi
|
2018-08-05 18:38:28 +02:00
|
|
|
|
2019-03-05 12:59:44 +01:00
|
|
|
# .bracketexpr.generated.ts is needed for metadata generation
|
2019-05-31 16:48:53 +01:00
|
|
|
"$(yarn bin)/nearleyc" src/grammars/bracketexpr.ne > \
|
2019-04-11 18:37:29 +02:00
|
|
|
src/grammars/.bracketexpr.generated.ts
|
2019-03-05 12:59:44 +01:00
|
|
|
|
2018-08-05 18:38:28 +02:00
|
|
|
# It's important to generate the metadata before the documentation because
|
|
|
|
# missing imports might break documentation generation on clean builds
|
2019-05-31 16:48:53 +01:00
|
|
|
"$(yarn bin)/tsc" compiler/gen_metadata.ts -m commonjs --target es2017 \
|
2018-08-16 20:53:10 +02:00
|
|
|
&& node compiler/gen_metadata.js \
|
|
|
|
--out src/.metadata.generated.ts \
|
|
|
|
--themeDir src/static/themes \
|
2018-10-04 17:57:44 +02:00
|
|
|
src/excmds.ts src/lib/config.ts
|
2018-08-05 18:38:28 +02:00
|
|
|
|
2017-11-12 01:42:55 +00:00
|
|
|
scripts/newtab.md.sh
|
2018-04-13 23:30:53 +01:00
|
|
|
scripts/make_tutorial.sh
|
2019-02-25 13:47:22 +01:00
|
|
|
scripts/make_docs.sh
|
2017-11-12 01:42:55 +00:00
|
|
|
|
2021-01-01 16:10:03 +01:00
|
|
|
webpack --stats errors-only --bail
|
2018-03-04 14:42:35 +01:00
|
|
|
|
2021-01-11 07:07:15 +01:00
|
|
|
# "temporary" fix until we can install new native on CI: install the old native messenger
|
|
|
|
if [ "$1" = "--old-native" ]; then
|
|
|
|
if [ "$(isWindowsMinGW)" = "True" ]; then
|
|
|
|
powershell \
|
|
|
|
-NoProfile \
|
|
|
|
-InputFormat None \
|
|
|
|
-ExecutionPolicy Bypass \
|
|
|
|
native/win_install.ps1 -DebugDirBase native
|
|
|
|
else
|
|
|
|
native/install.sh local
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-05-23 15:39:40 +01:00
|
|
|
scripts/authors.sh
|
2018-05-20 15:04:46 +01:00
|
|
|
|
2018-03-04 14:42:35 +01:00
|
|
|
if [ -e "$CLEANSLATE" ] ; then
|
2018-05-20 13:17:28 +01:00
|
|
|
cp -v "$CLEANSLATE" build/static/css/cleanslate.css
|
2018-03-04 14:42:35 +01:00
|
|
|
else
|
2019-05-31 16:48:53 +01:00
|
|
|
echo "Couldn't find cleanslate.css. Try running 'yarn install'"
|
2018-03-04 14:42:35 +01:00
|
|
|
fi
|
2018-10-10 18:41:08 +02:00
|
|
|
|
|
|
|
if [ -e "$TRIDACTYL_LOGO" ] ; then
|
2018-11-26 11:28:34 +02:00
|
|
|
# sed and base64 take different arguments on Mac
|
2019-02-19 17:49:40 +00:00
|
|
|
case "$(uname)" in
|
|
|
|
Darwin*) sed -i "" "s@REPLACE_ME_WITH_BASE64_TRIDACTYL_LOGO@$(base64 "$TRIDACTYL_LOGO")@" build/static/themes/default/default.css;;
|
2019-05-21 16:08:09 +09:00
|
|
|
*BSD) sed -in "s@REPLACE_ME_WITH_BASE64_TRIDACTYL_LOGO@$(base64 "$TRIDACTYL_LOGO" | tr -d '\r\n')@" build/static/themes/default/default.css;;
|
2018-11-27 18:38:39 +01:00
|
|
|
*) sed "s@REPLACE_ME_WITH_BASE64_TRIDACTYL_LOGO@$(base64 --wrap 0 "$TRIDACTYL_LOGO")@" -i build/static/themes/default/default.css;;
|
|
|
|
esac
|
2018-10-10 18:41:08 +02:00
|
|
|
else
|
|
|
|
echo "Couldn't find Tridactyl logo ($TRIDACTYL_LOGO)"
|
|
|
|
fi
|