-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$current_location = Get-Location | ||
$project_root = git rev-parse --show-toplevel | ||
Set-Location $project_root/bridge | ||
|
||
foreach ($opt in $args) { | ||
switch ($opt) { | ||
"--silent" { $silent = $true } | ||
default { | ||
Write-Host "Invalid option: $opt" | ||
exit | ||
} | ||
} | ||
} | ||
|
||
if ($silent) { $log_level = "--log-level=warning" } | ||
|
||
if (!$silent) { Write-Host "Transpile and bundle TS sources to webui.js" } | ||
esbuild --bundle --target="chrome90,firefox90,safari15" --format=esm --tree-shaking=false --outdir=. ./webui_bridge.ts $log_level | ||
|
||
if (!$silent) { Write-Host "Convert JS source to C header" } | ||
python3 js2c.py | ||
|
||
if (!$silent) { Write-Host "Done." } | ||
Set-Location $current_location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
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 |