From 849b87904a10ae09dab1c9f8b99479544cd633d0 Mon Sep 17 00:00:00 2001 From: arzumify Date: Tue, 29 Oct 2024 12:53:47 +0000 Subject: [PATCH] Updated everything, used the updated build script --- build.sh | 13 ++++++++++++- go.mod | 8 +++----- go.sum | 4 ++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index 05e6bfe..4b65364 100755 --- a/build.sh +++ b/build.sh @@ -5,8 +5,19 @@ resourceDir="$path/../../resources/322dc186-04d2-4f69-89b5-403ab643cc1d" rm -rf "$resourceDir" || exit 1 rm -rf "$path/../../services/data-tracker.fgs" || exit 1 cd "$path" || exit 1 +printf "\033[1;35mBuilding data-tracker.fgs...\033[0m\n" go build -o "$path/../../services/data-tracker.fgs" --buildmode=plugin -ldflags "-s -w" || exit 1 cd "$path/resources/wasm/oauth" || exit 1 -GOOS=js GOARCH=wasm go build -o "$resourceDir/static/wasm/oauth.wasm" -ldflags "-s -w" || exit 1 +find -L "$path/resources/wasm" -type f -name "main.go" | while read -r mainGo; do + buildDir=$(dirname "$mainGo") + baseName=$(basename "$buildDir") + printf "\033[1;34m\033[1;33mBuilding WASM object %s...\033[0m\n" "$baseName" + (cd "$buildDir" && GOOS=js GOARCH=wasm go build -o "$resourceDir/static/wasm/$(basename "$buildDir").wasm" -ldflags "-s -w") || { + printf "\033[1;31mError: %s failed.\033[0m\n" "$mainGo" + exit 1 + } +done +printf "\033[1;34mCopying static files...\033[0m\n" cp -r "$path/resources/static" "$resourceDir/" || exit 1 cp -r "$path/resources/templates" "$resourceDir/" || exit 1 +printf "\033[1;36mdata-tracker.fgs has been built successfully!\033[0m\n" diff --git a/go.mod b/go.mod index e859dbe..6d2830e 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,8 @@ module git.ailur.dev/ailur/datatracker go 1.23.1 require ( - git.ailur.dev/ailur/fg-library/v2 v2.1.0 - git.ailur.dev/ailur/fg-nucleus-library v1.0.2 + git.ailur.dev/ailur/fg-library/v2 v2.1.1 + git.ailur.dev/ailur/fg-nucleus-library v1.0.3 github.com/golang-jwt/jwt/v5 v5.2.1 github.com/google/uuid v1.6.0 -) - -require github.com/go-chi/chi/v5 v5.1.0 +) \ No newline at end of file diff --git a/go.sum b/go.sum index f426ab7..60de925 100644 --- a/go.sum +++ b/go.sum @@ -4,10 +4,14 @@ git.ailur.dev/ailur/fg-library/v2 v2.0.1 h1:ltPYXf/Om0hnMD8gr1K5bkYrfHqKPSbb0hxa git.ailur.dev/ailur/fg-library/v2 v2.0.1/go.mod h1:1jYbWhabGcIwp7CkhHqvRwC8eP+nHv5BrXPe9NX2HE8= git.ailur.dev/ailur/fg-library/v2 v2.1.0 h1:SsLZ56poM6GZPfV/ywU/8WDTelu2dtlPp6jzbEZ4hrA= git.ailur.dev/ailur/fg-library/v2 v2.1.0/go.mod h1:1jYbWhabGcIwp7CkhHqvRwC8eP+nHv5BrXPe9NX2HE8= +git.ailur.dev/ailur/fg-library/v2 v2.1.1 h1:49NgKud/gJjlTPZQfrZkmx4b/IEa3ZkO/NNM8QGA3qk= +git.ailur.dev/ailur/fg-library/v2 v2.1.1/go.mod h1:Il3+GZ7tClNx4/QSt3eY4tR7NdvO+Qf00J0PKkxPrl4= git.ailur.dev/ailur/fg-nucleus-library v1.0.0 h1:TT1V4cfka+uUpvV1zU7bc4KXFkgnsI/sIvaZDDxXk+k= git.ailur.dev/ailur/fg-nucleus-library v1.0.0/go.mod h1:m4gNSEypfgrUV8bXaR8NLB8zchUM59y0ellV1wp/C+I= git.ailur.dev/ailur/fg-nucleus-library v1.0.2 h1:EWfeab+wJKaxx/Qg5TKpvZHicA0V/NilUv2g6W97rtg= git.ailur.dev/ailur/fg-nucleus-library v1.0.2/go.mod h1:T2mdUiXlZqb917CkNB2vwujkD/QhJDpCHLRvKuskBpY= +git.ailur.dev/ailur/fg-nucleus-library v1.0.3 h1:C0xgfZg7bkULhh9Ci7ZoAcx4QIqxLh+QW9/ng1kKTFU= +git.ailur.dev/ailur/fg-nucleus-library v1.0.3/go.mod h1:RbBVFRwtQgYvCWoru1mC3vUJ1dMftkNbvd7hVFtREFw= github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=