From 033475fd14b6cd38a921c742ded2e57e0af3e6f8 Mon Sep 17 00:00:00 2001 From: schreifuchs Date: Wed, 19 Feb 2025 15:07:42 +0100 Subject: [PATCH] setup script --- README.md | 2 +- setup.sh | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 setup.sh diff --git a/README.md b/README.md index 2f2545e..0d2c15b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ for [Windows](https://github.com/wailsapp/wails/issues/1292): ```sh sudo pacman -S mingw-w64-gcc -wails dev #to generate bindings +wails dev # to generate bindings env GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CGO_CXXFLAGS="-IC:\msys64\mingw64\include" wails build -ldflags '-extldflags "-static"' -skipbindings ``` diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..05a625d --- /dev/null +++ b/setup.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Get the current directory name +CURRENT_DIR_NAME=$(basename "$PWD") + +# Define the files to be updated +FILES=("main.go" "go.mod" "wails.json") + +# String to be replaced +OLD_STRING="wails-template" + +# Loop through the files and replace occurrences of the old string +for file in "${FILES[@]}"; do + if [[ -f "$file" ]]; then + sed -i "s/${OLD_STRING}/${CURRENT_DIR_NAME}/g" "$file" + echo "Updated: $file" + else + echo "File not found: $file" + fi +done + +echo "You are rady to gooooo"