mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
Add MinGW build support and minor refactoring
This commit is contained in:
parent
aed05c5e94
commit
19e3363c92
2 changed files with 34 additions and 7 deletions
|
@ -33,7 +33,7 @@
|
|||
"webpack": "^3.8.1"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "scripts/build.sh",
|
||||
"build": "sh scripts/build.sh",
|
||||
"run": "web-ext run --firefox=firefox -s build/ -u 'txti.es'",
|
||||
"watch": "echo 'watch is broken, use build instead'; exit 0; chokidar src scripts --initial --silent -i 'src/excmds_{background,content}.ts' -i 'src/static/docs' -c 'npm run build'",
|
||||
"clean": "rm -rf build generated",
|
||||
|
|
|
@ -2,25 +2,52 @@
|
|||
|
||||
set -e
|
||||
|
||||
PATH=$(npm bin):"$PATH"
|
||||
export PATH
|
||||
CLEANSLATE="node_modules/cleanslate/docs/files/cleanslate.css"
|
||||
|
||||
isWindowsMingw() {
|
||||
local is_mingw="False"
|
||||
if [ "$(uname | cut -c 1-5)" == "MINGW" ]; then
|
||||
is_mingw="True"
|
||||
fi
|
||||
|
||||
echo -n "${is_mingw}"
|
||||
}
|
||||
|
||||
if [ "$(isWindowsMingw)" == "True" ]; then
|
||||
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
|
||||
|
||||
scripts/excmds_macros.py
|
||||
scripts/newtab.md.sh
|
||||
scripts/make_tutorial.sh
|
||||
scripts/make_docs.sh &
|
||||
nearleyc src/grammars/bracketexpr.ne > src/grammars/.bracketexpr.generated.ts
|
||||
native/install.sh local
|
||||
|
||||
(webpack --display errors-only && scripts/git_version.sh)&
|
||||
nearleyc src/grammars/bracketexpr.ne \
|
||||
> src/grammars/.bracketexpr.generated.ts
|
||||
|
||||
if [ "$(isWindowsMingw)" == "True" ]; then
|
||||
powershell native/win_install.ps1
|
||||
else
|
||||
native/install.sh local
|
||||
fi
|
||||
|
||||
(webpack --display errors-only \
|
||||
&& scripts/git_version.sh) &
|
||||
|
||||
wait
|
||||
|
||||
if [ -e "$CLEANSLATE" ] ; then
|
||||
cp "$CLEANSLATE" build/static/cleanslate.css
|
||||
cp -v "$CLEANSLATE" build/static/cleanslate.css
|
||||
else
|
||||
echo "Couldn't find cleanslate.css. Try running 'npm install'"
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue