mirror of
https://github.com/webui-dev/webui.git
synced 2024-09-11 22:17:13 +03:00
37 lines
905 B
Bash
Executable File
37 lines
905 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# http://webui.me
|
|
# https://github.com/webui-dev/webui
|
|
# Copyright (c) 2020-2024 Hassan Draga.
|
|
# Licensed under MIT License.
|
|
# All rights reserved.
|
|
#
|
|
# Special Thanks to Turiiya (https://github.com/ttytm)
|
|
|
|
project_root=$(git rev-parse --show-toplevel)
|
|
cd $project_root/bridge
|
|
|
|
# Loop through all arguments
|
|
for opt in "$@"; do
|
|
case $opt in
|
|
--silent)
|
|
silent=true
|
|
;;
|
|
*)
|
|
echo "Invalid option: $opt"
|
|
exit 0
|
|
;;
|
|
esac
|
|
shift # Move to the next argument
|
|
done
|
|
|
|
if [ "$silent" = true ]; then log_level=--log-level=warning; fi
|
|
|
|
if [ "$silent" != true ]; then echo "Transpile and bundle TS sources to webui.js"; fi
|
|
esbuild --bundle --target="chrome90,firefox90,safari15" --format=esm --tree-shaking=false --outdir=. ./webui_bridge.ts $log_level
|
|
|
|
if [ "$silent" != true ]; then echo "Convert JS source to C header"; fi
|
|
python3 js2c.py
|
|
|
|
if [ "$silent" != true ]; then echo "Done."; fi
|