#!/usr/bin/env bash set -euo pipefail NAME=egui-circles BUILDER=$NAME-builder:wasm32 has_docker_image() { docker manifest inspect $1 } &> /dev/null has_docker_container() { docker container inspect $1 } &> /dev/null if ! has_docker_image $BUILDER; then echo "Docker $BUILDER was not found" read -p "Would you like to create builder image (y/N)? " case "$REPLY" in y|Y ) docker build \ --file wasm32/Dockerfile \ --tag $BUILDER \ . ;; * ) exit 1 ;; esac fi echo "--> Initiate WASM32 target build.." docker run \ --rm \ --volume $(pwd):/$NAME \ $BUILDER \ build --release --public-url /$NAME --verbose echo "--> wasm32 target can be found in dist/ folder" read -p "Would you like to publish (y/N)? " case "$REPLY" in y|Y ) cd dist/ git init git checkout -b main git add . git commit --message «v0.2.1» # solution for "send-pack: unexpected disconnect while reading sideband packet" git config http.postBuffer 157286400 git remote add origin https://gitea.djmil.dev/demo/egui-circles.git git push --set-upstream origin main --force echo "--> Published at https://demo.pages.djmil.dev/egui-circles" ;; * ) exit 0 ;; esac