mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* script for building examples minimal example updated to work with wasm-pack minimal_wb exampel to be used with wasm-bindgen directly * minimal is wasm-bindgen as default ( wp wasm-pack ) * examples updated to work with wasm-bindgen * script to run all yew/examples * upated example doc, added script to multi-thread * cargo fmt, disabled build_examples.sh * one build.sh for examples, updated doc * removed build size optimalization * wasm-pack requirement info in lib.rs * Update examples/readme.md * Update examples/readme.md * Update examples/readme.md * Update examples/readme.md * Update examples/readme.md * Update examples/readme.md * Update examples/readme.md * Update examples/readme.md * Update examples/readme.md * Update examples/readme.md * Update examples/build.sh Co-Authored-By: Justin Starry <justin.m.starry@gmail.com> * Update examples/build.sh exit trap Co-Authored-By: Justin Starry <justin.m.starry@gmail.com> Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
24 lines
1016 B
Bash
Executable File
24 lines
1016 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Script to build all examples in yew/examples
|
|
#
|
|
# Not building yew-router nor yewtil examples
|
|
|
|
# src: https://gist.github.com/fbucek/f986da3cc3a9bbbd1573bdcb23fed2e1
|
|
set -e # error -> trap -> exit
|
|
function info() { echo -e "[\033[0;34m $@ \033[0m]"; } # blue: [ info message ]
|
|
function fail() { FAIL="true"; echo -e "[\033[0;31mFAIL\033[0m] $@"; } # red: [FAIL]
|
|
trap 'LASTRES=$?; LAST=$BASH_COMMAND; if [[ LASTRES -ne 0 ]]; then fail "Command: \"$LAST\" exited with exit code: $LASTRES"; elif [ "$FAIL" == "true" ]; then fail finished with error; else echo -e "[\033[0;32m Finished $@ \033[0m]";fi' EXIT
|
|
SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # this source dir
|
|
|
|
cd $SRCDIR/../examples # switch to examples folder
|
|
|
|
for EXAMPLE in *
|
|
do
|
|
if [[ $EXAMPLE == static ]] || [[ $EXAMPLE == server ]] || [[ $EXAMPLE == target ]]; then
|
|
echo -e "Skipping folder: $EXAMPLE"
|
|
elif [ -d ${EXAMPLE} ]; then
|
|
./build.sh ${EXAMPLE} $@
|
|
fi
|
|
done
|