2025-02-19 15:07:42 +01:00
|
|
|
#!/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
|
|
|
|
|
2025-02-19 15:10:38 +01:00
|
|
|
|
|
|
|
#### finalize wails.json
|
|
|
|
|
|
|
|
USER_NAME=$(git config user.name)
|
2025-02-19 15:17:23 +01:00
|
|
|
E_USER_NAME=$(printf '%s\n' "$USER_NAME" | sed -e 's/[\/&]/\\&/g')
|
2025-02-19 15:10:38 +01:00
|
|
|
USER_EMAIL=$(git config user.email)
|
2025-02-19 15:17:23 +01:00
|
|
|
E_USER_EMAIL=$(printf '%s\n' "$USER_EMAIL" | sed -e 's/[\/&]/\\&/g')
|
2025-02-19 15:10:38 +01:00
|
|
|
|
2025-02-19 15:17:23 +01:00
|
|
|
|
|
|
|
sed -i "s/schreifuchss/${USER_NAME}/g" "wails.json"
|
|
|
|
sed -i "s/kontakt@schreifuchs\.ch/${USER_EMAIL}/g" "wails.json"
|
2025-02-19 15:10:38 +01:00
|
|
|
|
2025-02-19 15:07:42 +01:00
|
|
|
echo "You are rady to gooooo"
|