Better build and run scripts

This commit is contained in:
Jeremy Wall 2022-02-12 09:04:44 -05:00
parent 2282192678
commit 9c5d127b4e
2 changed files with 11 additions and 5 deletions

View File

@ -13,11 +13,17 @@
# limitations under the License.
kitchen: wasm kitchen/src/*.rs
cp -r web/dist kitchen/webdist
cd kitchen; cargo build
wasm: web/index.html web/src/*.rs
release: wasmrelease
cd kitchen; cargo build --release
wasmrelease: web/index.html web/src/*.rs web/src/components/*.rs
cd web; trunk build --release --public-url /ui/ --dist ../kitchen/webdist
wasm: web/index.html web/src/*.rs web/src/components/*.rs
cd web; trunk build --public-url /ui/
cp -r web/dist kitchen/webdist
clean:
rm -rf web/dist/* kitchen/webdist

6
run.sh
View File

@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
EXAMPLES=${EXAMPLES:-../examples}
make clean kitchen
pushd web
trunk serve \
@ -21,7 +21,7 @@ trunkpid=$!
popd
trap "{ echo killing ${trunkpid}; kill -9 ${trunkpid}; }" EXIT
pushd kitchen
echo Starting api server
cargo run -- serve --dir ../examples
echo Starting api server serving ${EXAMPLES}
cargo run -- serve --dir ${EXAMPLES}
popd
# This is ghetto but I'm doing it anyway